go-struct-tag
A Visual Studio Code extension for autocompleting Go struct tags while typing.
Note
If the extension doesn't work, please add the following configuration in settings.json
:
Open Command Palette (⌘ + ⇧ + P) then Preferences: Open Settings (JSON)
"editor.quickSuggestions": {
"strings": true
}
"editor.suggest.showWords": true,
Configuration
go-struct-tag.cases
Add entries into go-struct-tag.cases
to set the field name format.
Supported formats:
snake
camel
pascal
constant
none
Below are the default settings:
"go-struct-tag.cases": [
"snake",
"camel"
]
Use custom tags.
Example:
"go-struct-tag.customTags": {
"customTag1": {
"cases": [
"snake"
],
"options": [
"omitempty",
"string",
"-"
],
"separator": ","
},
"customTag2": {
"cases": []
},
"customTag3": {}
}
customTag1
, customTag2
, customTag3
: Custom tag names
cases
: Field name formatting for this tag. If not set, it uses the value of go-struct-tag.cases
. If set to []
, the field name will not be used.
options
: A list of options following the field name. If not set, no options will be used.
separator
: Separator between options. If not set, it defaults to ,
.
Features
Default supported tags: