mac 设置go环境

394 阅读1分钟

1.vim ~/.bash_profile

export GOROOT=/usr/local/Cellar/go/1.13.5/libexec
export GOBIN=/Users/edz/go/bin

2. in vscode settings.json

  "go.useLanguageServer": true,
  "go.goroot": "",
  "go.gopath": "",
  "go.inferGopath": true,
  "go.autocompleteUnimportedPackages": true,
  "go.gocodePackageLookupMode": "go",
  "go.gotoSymbol.includeImports": true,
  "go.useCodeSnippetsOnFunctionSuggest": true,
  "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
  "go.docsTool": "gogetdoc",