Skip to content

Commit

Permalink
Add Go tools installation and golangci-lint setup
Browse files Browse the repository at this point in the history
  • Loading branch information
arloor committed Dec 27, 2023
1 parent 6d2558f commit 1831042
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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}"
}
]
}
9 changes: 8 additions & 1 deletion init_vscode_go.sh
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
echo "Installing golangci-lint latest..."
curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b "$HOME/go/bin"

0 comments on commit 1831042

Please sign in to comment.