fangmd / blogsource

6 stars 0 forks source link

go #92

Open fangmd opened 1 year ago

fangmd commented 1 year ago

go 语言特征

fangmd commented 1 year ago

mod

# enable Go modules support
GO111MODULE=on

# initializing dependencies file (go.mod)
$ go mod init

# installing a module
$ go get github.com/go-shadow/moment

# updating a module
$ go get -u github.com/go-shadow/moment

# removing a module
$ rm -rf $GOPATH/pkg/mod/github.com/go-shadow/moment@v<tag>-<checksum>/

# pruning modules (removing unused modules from dependencies file)
$ go mod tidy

# download modules being used to local vendor directory (equivalent of downloading node_modules locally)
$ go mod vendor