Suppress Warning in VSCode

455 views
Skip to first unread message

Kaveh Shahbazian

unread,
Feb 26, 2021, 8:22:21 PM2/26/21
to golang-nuts

This is a simple snippet for writing BDD-style tests in go.

When the package support is imported in the tests for another package, vscode shows a warning composite literal uses unkeyed fields.

How to suppress this message?

What would be nice to have, is a comment for ignoring these cases, at least in tests. Like //nolint comment of golangci-lint tool.

Currently, the only way to suppress this warning, is to change this setting for gopls, which is not the best solution:

"gopls": {
    "analyses": {
        "composites": false
    }
},

Reply all
Reply to author
Forward
0 new messages