diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d7bbe64 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Package", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmd/${workspaceFolderBasename}" + } + ] +} \ No newline at end of file diff --git a/init_vscode_go.sh b/init_vscode_go.sh index 062069b..c462d0b 100644 --- a/init_vscode_go.sh +++ b/init_vscode_go.sh @@ -1,3 +1,7 @@ +#参考 https://github.com/devcontainers/features/blob/main/src/go/install.sh#L54 + +# Install Go tools that are isImportant && !replacedByGopls based on +# https://github.com/golang/vscode-go/blob/v0.38.0/src/goToolsInformation.ts GO_TOOLS="\ golang.org/x/tools/gopls@latest \ honnef.co/go/tools/cmd/staticcheck@latest \ @@ -8,5 +12,8 @@ GO_TOOLS="\ github.com/haya14busa/goplay/cmd/goplay@latest \ github.com/cweill/gotests/gotests@latest \ github.com/josharian/impl@latest" +(echo "${GO_TOOLS}" | xargs -n 1 go install -v )2>&1 | tee -a ./init_go.log - (echo "${GO_TOOLS}" | xargs -n 1 go install -v )2>&1 | tee -a ./vscode-dev-containers/go.log \ No newline at end of file +echo "Installing golangci-lint latest..." +curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \ + sh -s -- -b "$HOME/go/bin" \ No newline at end of file