by lucideer · 2y ago · 0 comments
I noticed that the syntax highlighting for the Go html/template examples in the article is incomplete. We're using Go html/templates on a new project (within a team that does a lot of React frontend & some Python) so this kind of project seems like it would really suit, but a massive bugbear has been the very poor IDE-level syntax highlighting support for Go html/templates. Can anyone recommend a good syntax highlighter for Go html/template in VSCode for example? None of the main/official/popular addons seem to get this right.
Seems a pretty unexpected oversight from a language from Google.
Sorry, it might be something wrong with my blog setup. I use hexo, might need to play around with the config.
I use this VSCode extension for coding and it works fairly well: https://marketplace.visualstudio.com/items?itemName=jinlimin...
See https://github.com/PDOK/gokoala?tab=readme-ov-file#intellij-... for a script to set this up.
E.g. (from the article):
<a class="button {{if .IsPrimary}}primary{{end}}" {{if eq .IsSubmit true}}type="submit"{{else}} href="{{.Link}}"{{end}}>