mkdir -p ~/Go/{bin,pkg,src}
# go environment
export GOPATH=$HOME/Go
export PATH=$GOBIN:$PATH
export GOBIN=$GOPATH/bin
export GOROOT=/usr/local/opt/go/libexec
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/jstemmer/gotags
go get -u -v golang.org/x/tools/cmd/goimports
go get -u -v github.com/zmb3/gogetdoc
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v github.com/cweill/gotests
go get -u -v golang.org/x/tools/cmd/godoc
go get -u -v github.com/fatih/gomodifytags
go get -u -v github.com/derekparker/delve/cmd/dlv
go get -u -v github.com/kisielk/errcheck
go get -u -v github.com/alecthomas/gometalinter
go get -u -v github.com/klauspost/asmfmt/cmd/asmfmt
go get -u -v github.com/fatih/motion
go get -u -v github.com/zmb3/gogetdoc
go get -u -v github.com/josharian/impl
go get -u -v github.com/dominikh/go-tools/cmd/keyify
go get -u -v github.com/nsf/gocode
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v github.com/jgautheron/goconst/cmd/goconst
go get -u -v github.com/jgautheron/usedexports
go get -u -v github.com/gordonklaus/ineffassign
go get -u -v golang.org/x/tools/cmd/oracle
go get -u -v golang.org/x/tools/cmd/vet
"cmd+shift+p": “go:install/update tools” 安装插件, 全部选择 "go.toolsGopath": “指定tools包的路径,不指定默认在 GOPATH”
{
"go.gopath": "${workspaceFolder}",
"go.inferGopath": true,
"go.autocompleteUnimportedPackages": true,
"go.gocodePackageLookupMode": "go",
"go.gotoSymbol.includeImports": true,
"go.useCodeSnippetsOnFunctionSuggest": true,
"go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
"go.docsTool": "gogetdoc"
}
- go get
- go run
- go build
- go fmt
- go install
- go test
- go doc
var a int、var a, b int = 1, 2
var a, b, c = 1, "go", true
a, b, c := 1, "go", true
var (
a = 1
b = "go"
c = true
)
// :=只能在函数内使用,不能用在函数外