Mac zshにインストール
git clone https://github.com/syndbg/goenv.git ~/.goenv echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.zshenv echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.zshenv echo 'eval "$(goenv init -)"' >> ~/.zshenv exec $SHELL
% goenv -v goenv 2.0.0beta11
$ goenv install -l 1.16.3 1.16.4 1.16.5 1.16.6 1.16.7 1.16.8 1.17.0 1.17beta1 1.17rc1 1.17rc2 1.17.1
$ goenv install 1.17.1 $ goenv global 1.17.1 $ go version go version go1.17.1 darwin/amd64
$ go env -w GO111MODULE=on $ go env GO111MODULE on
VS Codeプラグイン
git clone -b bingo https://github.com/saibing/tools.git cd tools/gopls go install
VS Code setting.json
・・・ "go.useLanguageServer": true, "go.alternateTools": { "go-langserver": "gopls" }, "go.languageServerExperimentalFeatures": { "format": true, "autoComplete": true, "rename": true, "goToDefinition": true, "hover": true, "signatureHelp": true, "goToTypeDefinition": true, "goToImplementation": true, "documentSymbols": true, "workspaceSymbols": true, "findReferences": true, "diagnostics": true }, "": { "editor.snippetSuggestions": "none", "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.organizeImports": true }, }, "gopls": { "usePlaceholders": true, "enhancedHover": true }
@see