Getting Started
Building and Using Go Private Packages
· ☕ 3 min read
1. Create a Go Modules Project Create the directory 1 2 mkdir go-test cd go-test Initialize the package 1 2 3 4 5 go mod init gitlab.private.com/shaowenchen/go-test go: creating new go.mod: module gitlab.private.com/shaowenchen/go-test go: to add module requirements and sums: go mod tidy Add the business code main.go 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package main import ( "github.

Go Development Configuration
· ☕ 4 min read
1. Common Environment Variables 1.1 GOROOT $GOROOT is the local directory where the Go package is installed. 1 2 3 4 cd /c/Go ls AUTHORS CONTRIBUTORS PATENTS VERSION bin favicon.ico misc robots.txt test CONTRIBUTING.md LICENSE README.md api doc lib pkg src 1.2 GOPATH $GOPATH is the Go workspace directory, used to hold code, third-party libraries, compiled intermediate files, and so on.