# Can't get the syntax highlighting for Go

The syntax highlighting (for Go) does not seem to be applied for this question: db access wrapper for Go project

I tried to apply it manually to my answer (https://codereview.stackexchange.com/a/169234/80949), using <!-- language-all: lang-go -->, but it looks worst than in the question!

I know that syntax highlighting for Go can look better on CR (see Generate thousands of JSON documents in Go): how can we fix this?

Edit this is probably related to the database tag (as Peilonrayz noticed): if you remove it, the syntax highlighting works fine.

A bug remains: why can't I force the go highlighting on a database question?

• I removed the database tag from the question in the edit screen, and it changed the code to what you expected. Aside: I personally don't know why that tag changes syntax highlighting...
– Peilonrayz Mod
Jul 14, 2017 at 10:56
• From what I understand, the tag is an hint for the right syntax highlighting. In this case it seems to be an obstacle to language customization. Jul 14, 2017 at 11:33

The tag didn't have an associated syntax highlighter, so the highlighting you'd get with the tag alone would have been the default one.

<!-- language: lang-go -->


should actually be

<!-- language: lang-golang -->


That's the highlighter I've just associated with the tag, so all GO questions and answers should now have correct & proper syntax highlighting... Unless some erroneous <!-- language hint is in place.

Aside: I personally don't know why that tag changes syntax highlighting... – Peilonrayz

You don't get to see it, but tags' Info page have a syntax highlighting dropdown that determines how a given tag affects how code gets syntax-highlighted in a post. In the case of GO, that dropdown was set to "none".

• Oh look, there's a syntax highlighting dropdown! Seems like I haven't visited a tag info page since I became a moderator. Shame on me. Jul 14, 2017 at 13:35
• When I said the 'aside', my main point was, 'I don't know why the database tag would have the syntax highlighting specified to anything but "none"'. That must have been unclear of me, sorry.
– Peilonrayz Mod
Jul 14, 2017 at 13:46
• @Peilonrayz ha! correct - it was set to lang-sql, I've just set it to none. Thanks! ..side-effect of this being any database post without a sql tag just lost its syntax highlighting. Jul 14, 2017 at 13:47
• @Mat'sMug Kinda reminds me of how the Python tags work. There shouldn't be any like that IMO anyway, :)
– Peilonrayz Mod
Jul 14, 2017 at 13:52
• @Mat'sMug You mean questions like a few of these? ? Jul 14, 2017 at 20:58
• @SimonForsberg from a quick look at a couple of them, yes, indeed - and it's much better that way! (none of the 5-6 ones I opened had actual SQL in them) Jul 14, 2017 at 21:04