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

参考

失敗から学ぶユーザインタフェース 世界はBADUI(バッド・ユーアイ)であふれている
[ad] 失敗から学ぶユーザインタフェース 世界はBADUI(バッド・ユーアイ)であふれている
中村 聡史 (大型本)