go language - operation and interpretation of documents

First, the file storage location

  bin file: after leaving compiled binary file

  pkg files: repository file compiled

  src file: storing source code file

Second, the commonly used commands to run files

  Two operational difference (direct run after run and compile)

           1, the compiler generates an executable file, you can not go running in the development environment

           2, compiled files will become much larger, because the compiler will run when the dependent libraries included in the file

           3, direct running, the machine needs to have go development environment

  Run the program directly: go run in the terminal input file name .go

  Compiler: go build

  Modify the file name when you compile: go build -o filename .go

Third, compiled linux file

    Set CGO_ENABLED = 0 // 禁用 CGO

  SET GOOS = LINUX // target platform is linux

       SET GOARCH = amd64 // target processor architecture amd64

 

Guess you like

Origin www.cnblogs.com/puti306/p/11407276.html