Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Band-Aid "go vet" error with Go codegen template #4445

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

SeanPMiller
Copy link

Resolves #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:

golang/go#16370

@simeonmiteff
Copy link

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'

@SeanPMiller
Copy link
Author

Given what a showstopper bug this is for Go developers, I'm surprised it has been languishing unmerged.

@jimidle
Copy link
Collaborator

jimidle commented Apr 9, 2024

Showstopper? Really? Why would you run go vet on generated code?

@SeanPMiller
Copy link
Author

Really. Have you tried to go vet a Go module that depends on another module generated by ANTLR?

@SeanPMiller
Copy link
Author

I'll excuse your obnoxious comment.

@jimidle
Copy link
Collaborator

jimidle commented Apr 9, 2024

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.

@SeanPMiller
Copy link
Author

Understood. I've been there. Are y'all short on volunteers?

@vecknishwaran
Copy link

Hi, just checking in on the status of this PR. Are there any plans to merge it for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated Go parser fails "go vet"
4 participants