antlr4
                                
                                
                                
                                    antlr4 copied to clipboard
                            
                            
                            
                        Band-Aid "go vet" error with Go codegen template
Resolves https://github.com/antlr/antlr4/issues/4439
This may not work forever. If it ever stops working, then we can switch to using a const variable, as  that is how Rob Pike & Co. intend for debugging-logic to work. Refer to the following issue:
https://github.com/golang/go/issues/16370
To any fellow travelers wondering how to get this (in lieu of this PR being merged), pipe your generated code through:
  tr '\n' '\f' | \
  sed 's|return localctx\f\tgoto errorExit // Trick to prevent compiler error if the label is not used|if false {\f          goto errorExit // Trick to prevent compiler error if the label is not used\f    }\f    return localctx|g' | \
  tr '\f' '\n'
                                    
                                    
                                    
                                
Given what a showstopper bug this is for Go developers, I'm surprised it has been languishing unmerged.
Showstopper? Really? Why would you run go vet on generated code?
Really. Have you tried to go vet a Go module that depends on another module generated by ANTLR?
I'll excuse your obnoxious comment.
Yeah. Sorry - I did not read this correctly. I will add it, but I am just overrun at the moment and have been for a whlie.
Understood. I've been there. Are y'all short on volunteers?