Overview Version History Q & A Rating & Review
go-templates-snippets
This extension contains code snippets for Golang templates for Visual Studio Code editor. Supports .go, .gotmpl, .html and their file associations.
Supported file extensions
.go
.gotmpl
.html
file associations of .gotmpl and .html
Snippets
Below is a list of all available snippets.
Trigger
Content
tblock
{{ block "name" pipeline }}
tblockend
{{ block "name" pipeline }} ... {{ end }}
tbreak
{{ break }}
tcontinue
{{ continue }}
tdefine
{{ define "name" }}
tdefineend
{{ define "name" }} ... {{ end }}
telse
{{ else }}
telseif
{{ else if (condition) }}
tend
{{ end }}
tif
{{ if (condition) }}
tifend
{{ if (condition) }} ... {{ end }}
tifelseend
{{ if (condition) }} ... {{ else }} ... {{ end }}
tpartial
{{ partial "name" }}
tpipeline
{{ pipeline }}
trange
{{ range pipeline }}
trangeend
{{ range pipeline }} ... {{ end }}
ttemplate
{{ template "name" pipeline }}
twith
{{ with pipeline }}
twithend
{{ with pipeline }} ... {{ end }}
twithelseend
{{ with pipeline }} ... {{ else }} ... {{ end }}
twithelsepipeeend
{{ with pipeline }} ... {{ else with pipeline }} ... {{ end }}
Within a template file
Within a Go file
Press Space to generate suggestions
Kindly leave a star ⭐ if you find this project useful. It is a source of encouragement to me 🙏.
Cheers!
Golang icon by Icons8