This is a creation in Article, where the information may have evolved or changed.
Go Build
With Go build plus the Go source file name to compile, we can get an executable file, by default the name of the file is the name of the source file removed. go suffix.
$ go Build hello.go$ Lshello hello.go
Of course we can also use the-o option to specify a different name:
$ go build-o mygo hello.go$ Lsmygo hello.go
If we execute the go build command directly in the Go-examples directory, followed by a file name, we will get an executable with the same name as the directory name:
$ go build$ lsgo-examples hello.go
Go Install
When compared to the build command, the install command installs the executable file or library file into the agreed directory after compiling the source code.
Go install compiles the executable file named after its directory name (DIR)
Go install installs the executable file in the bin directory with the SRC peer, and the bin directory is created automatically by go install
Go install compiles the various package that the executable depends on and places it in the PKG directory at the same level as the SRC
Resources:
Http://www.cnblogs.com/ghj1976/archive/2013/04/23/3038347.html