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\""
    ],

参考

やりすぎの経済学 -中毒・不摂生と社会政策
[ad] やりすぎの経済学 -中毒・不摂生と社会政策
ハロルド・ウィンター, 河越正明 (単行本(ソフトカバー))