上QQ阅读APP看书,第一时间看更新
Building a folder (package)
If a package contains multiple Go files that need to be built, it is tedious to pass each file to the build command. If you run go build with no arguments inside a folder, it will attempt to build all the .go files in the directory. If one of those files contains a package main statement at the top, it will generate an executable named after the directory name. If you write a program, it is possible to write a package that contains no main file and is used only as a library to be included in other projects.