diff --git a/src/go/README.md b/src/go/README.md index 5f35da948..e6a75f608 100644 --- a/src/go/README.md +++ b/src/go/README.md @@ -17,6 +17,7 @@ Installs Go and common Go utilities. Auto-detects latest version and installs ne |-----|-----|-----|-----| | version | Select or enter a Go version to install | string | latest | | golangciLintVersion | Version of golangci-lint to install | string | latest | +| installGoTools | Install common Go tools | boolean | true | ## Customizations diff --git a/src/go/devcontainer-feature.json b/src/go/devcontainer-feature.json index b61e93605..7169115dd 100644 --- a/src/go/devcontainer-feature.json +++ b/src/go/devcontainer-feature.json @@ -20,7 +20,12 @@ "type": "string", "default": "latest", "description": "Version of golangci-lint to install" - } + }, + "installGoTools": { + "type": "boolean", + "default": true, + "description": "Install common Go tools (gopls, staticcheck, golint, revive, dlv, gomodifytags, goplay, gotests, impl, golangci-lint). Set to false to skip - useful when your postCreateCommand or CI already installs the tools it needs, or when you just want `go build`/`go install` support without the extra download/compile time." + } }, "init": true, "customizations": { diff --git a/src/go/install.sh b/src/go/install.sh index db0ac7977..3e5c95e24 100755 --- a/src/go/install.sh +++ b/src/go/install.sh @@ -9,11 +9,11 @@ TARGET_GO_VERSION="${VERSION:-"latest"}" GOLANGCILINT_VERSION="${GOLANGCILINTVERSION:-"latest"}" +INSTALL_GO_TOOLS="${INSTALLGOTOOLS:-"true"}" TARGET_GOROOT="${TARGET_GOROOT:-"/usr/local/go"}" TARGET_GOPATH="${TARGET_GOPATH:-"/go"}" USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}" -INSTALL_GO_TOOLS="${INSTALL_GO_TOOLS:-"true"}" # https://www.google.com/linuxrepositories/ GO_GPG_KEY_URI="https://dl.google.com/linux/linux_signing_key.pub"