一个典型的Golang workspace
包含3
个文件夹:
src contains Go source files organized into packages (one package per directory),
pkg contains package objects, and
bin contains executable commands.
src
包含这个工程的所有源码文件(包含依赖的第三方package
的源码),pkg
包含编译生成的package
目标文件,而bin
包含最后生成的可执行文件。下面是一个例子:
bin/
hello # command executable
outyet # command executable
pkg/
linux_amd64/
github.com/golang/example/
stringutil.a # package object
src/
github.com/golang/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
参考资料:
Workspaces。