Developer Setup
Required Go Version
- Required: Go
1.22.5(see.go-version)
Install Go
- Install Go
1.22.5from go.dev. - Verify your toolchain:
bash
go versionExpected output should contain go1.22.5.
Bootstrap Local Environment
From repository root:
bash
bash scripts/dev-setup.shThis downloads modules and runs the test suite.
Build and Test Manually
bash
go mod tidy
go build ./...
go test ./...
go vet ./...Or use:
bash
make build
make test
make lintVersion Injection for CLI
Build shadownet-inside with an explicit version string:
bash
go build -ldflags "-X main.version=0.1.0" -tags inside -o bin/shadownet-inside ./cmd/insideTroubleshooting
toolchain not available:
Install Go 1.22.5 locally and rerun commands; avoid relying on auto-download.
go.mod/go.sum changed in CI:
Run go mod tidy locally and commit the resulting go.mod and go.sum.
tests fail only in CI:
Check go version locally and ensure it matches CI (1.22.5).
- Offline development:
Warm module cache once (go mod download) before going offline.