Lang Go Dep Manage

glide To upgrade dependencies, please make the necessary modifications in glide.yaml and run glide update.


go doc https://golang.google.cn proxy 从 Github 的代码库 clone go get -u github.com/golang/text mv $GOPATH/src/github.com/golang/text $GOPATH/src/golang.org/x/text go get -u github.com/golang/crypto mv $GOPATH/src/github.com/golang/crypto $GOPATH/src/golang.org/x/crypto 设置 GOPROXY 环境变量配置代理 例如:GOPROXY=https://goproxy.io https://github.com/northbright/Notes/blob/master/Golang/china/get-golang-packages-on-golang-org-in-china.md https://gocn.vip/article/1678

Go Module

Modules A module is a collection of related Go packages that are versioned together as a single unit. Modules record precise dependency requirements and create reproducible builds. go.mod A module is defined by a tree of Go source files with a go.mod file in the tree’s root directory. Module source code may be located outside of GOPATH. There are four directives: module, require, replace, exclude.


Method’s receiver go don’t user special name like( this or self ) for the receiver func (p Point) MoveBy(factor float){ p.X += factor //-> this.X += factor } Pointer receiver project-layout Internal app/pkg Directory Clarification Using /internal/pkg is about consistency if you use the /pkg pattern. The public shared code goes in ‘/pkg’ and the private shared code goes in /internal/pkg https://github.com/golang-standards/project-layout/issues/9 vendor package go help gopath find .