$ cd LetsGo
$ go build
$ ./letsgo
Every Go code will reside in your workspace. A workspace is a directory in your file system to which the path is stored in environment variable GOPATH
. The most basic structure should contain a src
directory.
Each Go package is created as a subdirectory within src
. The following is the example from Go Article
src/
github.com/LetsGo/example/
.git/ # Git repository metadata
hello/
hello.go # command source
outyet/
main.go # command source
main_test.go # test source
stringutil/
reverse.go # package source
reverse_test.go # test source
golang.org/x/image/
.git/ # Git repository metadata
bmp/
reader.go # package source
writer.go # package source
... (many more repositories and packages omitted) ...