I am just learning Golang templating. I am trying to use blocks. VS Code or gopls
is formatting my blocks in a very unreadable way.
I want to define a number of blocks in a single HTML file (index.html). When I save the file VS Code is reformatting to this {{ block "one" . }} . . . {{ end }} {{ block "two" . }} . . . {{ end }}
I want the format to be:
{{ block "one" . }} . . . {{ end }}
{{ block "two" . }} . . . {{ end }}
I have tried the following VS Code settings:
"[go]": {
"editor.insertSpaces": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
}
}
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.insertSpaces": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
}
}
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.insertSpaces": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
}
},
"gopls": {
"formatting.gofumpt": true
},
"[go]": {
"editor.insertSpaces": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
}
},
"gopls": {
"formatting.gofumpt": true
},
None of these settings change the behavior. I have reloaded the VS Code window with every setting change.