- $GOPATH is the well known place where
golooks for things and installs built things.
go install <path>
<path>is relative to
For example, the following will attempt to compile code found in
$> go install my-app
go installdoesn't care if
package <name>matches the fs path structure.
When the name of a package is
main, that package ends up in
$GOPATH/binas an executable.
You must define
mainfunc when the package is
main- aka you wanted an executable package. If you don't define
main, you'll see:
runtime.main: call to external function main.main runtime.main: main.main: not defined runtime.main: undefined: main.main
1. Any package installed in `$GOPATH/pkg` can be `import`ed. 1. Dependencies `imported` will be built and installed when the parent is built and installed... turtles! 1.