Skip to content

Instantly share code, notes, and snippets.

@r3code
Last active August 23, 2023 02:49
Show Gist options
  • Save r3code/21d1e9a3f862ad865808f07225b59068 to your computer and use it in GitHub Desktop.
Save r3code/21d1e9a3f862ad865808f07225b59068 to your computer and use it in GitHub Desktop.
Visual Studio Code - Code Spell Checker config for GoLang
{
// Add to VS Code settings.js file
"cSpell.languageSettings": [
// GoLang settings
{
"languageId": "go",
// Turn off compound words, because it is only checking strings.
"allowCompoundWords": false,
// Only check comments and strings
"includeRegExpList": [
"CStyleComment",
"string"
],
// Exclude imports, because they are also strings.
"ignoreRegExpList": [
// ignore mulltiline imports
"import\\s*\\((.|[\r\n])*?\\)",
// ignore single line imports
"import\\s*.*\".*?\"",
// ignore go generate directive
"//\\s*go:generate.*",
// ignore nolint directive
"//\\s*nolint:.*"
],
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment