Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Go Templates Snippets for VSCodeNew to Visual Studio Code? Get it now.
Go Templates Snippets for VSCode

Go Templates Snippets for VSCode

Orim Dominic

|
263 installs
| (0) | Free
This extension contains code snippets for Golang templates for the Visual Studio Code editor. It supports .go, .gotmpl, .html and their file associations.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft