created: 2020-12-31T13:31:54.000Z

vscodeでgolintの警告を抑制する

vscodeでgolangをgolintしながら書いていると、以下のようなwarningが出る。

exported type Expression should have comment or be unexportedgo-lint

publicなコードには説明が必要。というルールだが小さな関数とかだといちいちやってられないので、このwarningを抑制したい。

こんな設定で警告が消える。

    "go.lintTool": "golint",
    "go.lintFlags": [
      "--exclude=\"\bexported \\w+ (\\S*['.]*)([a-zA-Z'.*]*) should have comment or be unexported\b\""
    ],

参考

詳解 Terraform 第3版 ―Infrastructure as Codeを実現する
[ad] 詳解 Terraform 第3版 ―Infrastructure as Codeを実現する
Yevgeniy Brikman, 松浦 隼人 (単行本(ソフトカバー))