Interactive setup for Go LSP development environment
Sets up Go LSP with gopls and essential tools (linting, security scanning, import management). Use this to configure a complete Go development environment for Claude Code.
/plugin marketplace add zircote/go-lsp/plugin install go-lsp@zircote-lspThis command will configure your Go development environment with gopls LSP and essential tools.
First, verify Go is installed:
go version
Ensure ~/go/bin is in your PATH:
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc
source ~/.zshrc
go install golang.org/x/tools/gopls@latest
# Linting
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Security scanning
go install golang.org/x/vuln/cmd/govulncheck@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest
# Import management
go install golang.org/x/tools/cmd/goimports@latest
# Static analysis
go install honnef.co/go/tools/cmd/staticcheck@latest
gopls version
golangci-lint --version
govulncheck -version
export ENABLE_LSP_TOOL=1
Test the LSP integration:
# Create a test module
mkdir -p /tmp/test-go-lsp && cd /tmp/test-go-lsp
go mod init test
echo 'package main; func main() { println("Hello") }' > main.go
# Run checks
go vet ./...
golangci-lint run
# Clean up
cd - && rm -rf /tmp/test-go-lsp