Setup Go Development Environment
The followings are the recommended tools to set up:
delve
golangci-lint
delve
Installing delve:
go install github.com/go-delve/delve/cmd/dlv@latest
Navigate here to see more details.
golangci-lint
Two methods shown here to install golangci-lint:
- Using the official script
- Using mise
Installing golangci-lint
using the official script:
Using the official script
Use pre-built binary (Recommended)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0
Use go toolchain (aren’t guaranteed to work)
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.5.0
Reference: golangci-lint documentation
Using mise
mise use golangci-lint -g