安装 IDE 插件
安装 IDE 插件
Section titled “安装 IDE 插件”VS Code
Section titled “VS Code”安装以下插件以获得完整的 Go 开发体验:
| 插件 | 功能 |
|---|---|
| Go | Go 语言支持(必装) |
| goctl | .api 文件语法高亮和补全 |
| Proto Lint | .proto 文件代码检查 |
| REST Client | 在编辑器内发送 HTTP 请求 |
安装后,将以下内容添加到 settings.json:
{ "go.toolsManagement.autoUpdate": true, "go.useLanguageServer": true, "gopls": { "ui.semanticTokens": true }}GoLand / IntelliJ IDEA
Section titled “GoLand / IntelliJ IDEA”在 Plugins 搜索并安装:
| 插件 | 功能 |
|---|---|
| Go | 内置支持(GoLand 自带) |
| goctl | .api 语法支持和 goctl 命令集成 |
| Protocol Buffer | .proto 支持 |
Neovim
Section titled “Neovim”使用 nvim-lspconfig 配置 gopls:
require('lspconfig').gopls.setup({ settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true, }, },})