I've just installed Go from the package on the golang site.
When trying to build (or run) import getting an import error, but can't figure out why:
go build world2.go
This produces the error:
# world2.go:3:8: import "world": cannot find package
Running "go env" produces:
GOROOT="/usr/local/go" GOBIN="/usr/local/go/bin" GOARCH="amd64" GOCHAR="6" GOOS="darwin" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-common" CGO_ENABLED="1"
This is what my file structure looks like (ala tree):
. ├── world.go └── world2.go
Any tips what I'm doing wrong or next steps?
Now if all you want to do is export something from a single source then just capitalize it as you had done in Greeting. If it is apart of the same package then it is visible.
go build
Ola!