If you enter two open curly braces {{ inside a string literal, e.g.: “{{” or {{
, it messes up the whole syntax highlighting until it sees a }}. However, this isn’t expected, e.g.:
fmt.Println("{{")
compiles and runs in Go, without closing off “}}”. you can try escaping it with {{ which fixes the highlighting, but doesn’t compile because it’s not a valid escape character. My current solution is to just do:
fmt.Println("{{") // "}}" some comment explaining why I have this weird comment
Then, the syntax highlighting is only messed up for that line, and doesn’t affect other lines, and the code still compiles