1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

vscodeでgoを使うとき初期に入れておくと便利なパッケージ

Posted at

vscodeで初期に入れておくと便利だった設定をメモしておきます。
まずはGoの拡張パッケージを入れます。
image.png

go fmt

設定を開いて以下のプルダウンをgofmtに設定します。
image.png

gopls

image.png

settings.jsonを開いて以下のように修正します。

settings.json
{
    "security.workspace.trust.untrustedFiles": "open",
    "go.formatTool": "gofmt",
    "gopls": {
        "ui.documentation": true,
        "hoverKind": "FullDocumentation"
    }
}

go test

settings.jsonを以下のように更新します。

settings.json
{
  "security.workspace.trust.untrustedFiles": "open",
  "go.formatTool": "gofmt",
  "gopls": {
    "ui.documentation": true,
    "hoverKind": "FullDocumentation"
  },
  "go.testEnvVars": {
    "GO_ENV": "test",
    "TSUNDERE_MODE": "true"
  },
  "go.testFlags": [
    "-v",
    "-count=1"
  ],
  "go.testTimeout": "60s",
  "go.coverOnSave": true,
  "go.coverageDecorator": {
    "type": "gutter"
  },
  "go.testExplorer.showOutput": "always"
}

dependi

go.modなどで使っているモジュールのバージョンが最新かチェックしてくれます。

image.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?