Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 11d1a99

Browse files
authored
install dlv-dap and use go install to install go tools (#985)
* install dlv-dap and use `go install` to install go tools dlv-dap is a delve built from the head. since go1.16, `go install` is the recommended way of installing tools and from go1.17 (to be released soon), `go get` will print out deprecation warning message and encourage users to use `go install`. * fix go install command
1 parent 8019070 commit 11d1a99

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

script-library/go-debian.sh

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,17 @@ else
148148
fi
149149

150150
# Install Go tools that are isImportant && !replacedByGopls based on
151-
# https://github.com/golang/vscode-go/blob/0c6dce4a96978f61b022892c1376fe3a00c27677/src/goTools.ts#L188
152-
# exception: golangci-lint is installed using their install script below.
151+
# https://github.com/golang/vscode-go/blob/0ff533d408e4eb8ea54ce84d6efa8b2524d62873/src/goToolsInformation.ts
152+
# Exception `dlv-dap` is a copy of github.com/go-delve/delve/cmd/dlv built from the master.
153153
GO_TOOLS="\
154-
golang.org/x/tools/gopls \
155-
honnef.co/go/tools/... \
156-
golang.org/x/lint/golint \
157-
github.com/mgechev/revive \
158-
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
159-
github.com/ramya-rao-a/go-outline \
160-
github.com/go-delve/delve/cmd/dlv \
161-
github.com/golangci/golangci-lint/cmd/golangci-lint"
154+
golang.org/x/tools/gopls@latest \
155+
honnef.co/go/tools/cmd/staticcheck@latest \
156+
golang.org/x/lint/golint@latest \
157+
github.com/mgechev/revive@latest \
158+
github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest \
159+
github.com/ramya-rao-a/go-outline@latest \
160+
github.com/go-delve/delve/cmd/dlv@latest \
161+
github.com/golangci/golangci-lint/cmd/golangci-lint@latest"
162162
if [ "${INSTALL_GO_TOOLS}" = "true" ]; then
163163
echo "Installing common Go tools..."
164164
export PATH=${TARGET_GOROOT}/bin:${PATH}
@@ -167,12 +167,15 @@ if [ "${INSTALL_GO_TOOLS}" = "true" ]; then
167167
export GOPATH=/tmp/gotools
168168
export GOCACHE=/tmp/gotools/cache
169169

170-
# Go tools w/module support
171-
export GO111MODULE=on
172-
(echo "${GO_TOOLS}" | xargs -n 1 go get -v )2>&1 | tee -a /usr/local/etc/vscode-dev-containers/go.log
170+
(echo "${GO_TOOLS}" | xargs -n 1 go install -v )2>&1 | tee -a /usr/local/etc/vscode-dev-containers/go.log
173171

174172
# Move Go tools into path and clean up
175173
mv /tmp/gotools/bin/* ${TARGET_GOPATH}/bin/
174+
175+
# install dlv-dap (dlv@master)
176+
go install -v github.com/go-delve/delve/cmd/dlv@master 2>&1 | tee -a /usr/local/etc/vscode-dev-containers/go.log
177+
mv /tmp/gotools/bin/dlv ${TARGET_GOPATH}/bin/dlv-dap
178+
176179
rm -rf /tmp/gotools
177180
chown -R ${USERNAME} "${TARGET_GOPATH}"
178181
fi

0 commit comments

Comments
 (0)