Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: improve go compiler's syntax error message style #39274
If i take a look at GCC 's error massage, i see that they are very user friendly and descriptive.
I wish Go compiler will have this features.
try helloworld on Go and GCC with syntax error. to understand what i am saying
While I understand the sentiment and agree that better error messages are a good thing for users, this issue doesn’t have a concrete proposal of what, precisely, should be improved. Without more actionable examples and proposed changes, this is difficult to act upon.
What, precisely, would you like to see changed?
i am unable to communicate my thought properly. sorry. English isn't my native language. currently i don't have access to a computer. i am writing this from a phone.
What you think about current error message style. are they good? if not, then discuss with core team and improve.
this is the only reason i can't learn Go. I make a lot of syntax error and when i try to compile Go compiler don't give any good suggestion.
Given two “hello, world” examples with syntax errors (in C and Go, respectively):
The warning is arguably more helpful, but both errors seem very similar. Note that Go doesn’t have warnings. If we interpret the warning as an error, then how granular is this specific request? Show a ^ under the offending line? Color-code the output? Show an error when there is no terminating quote in a string? That’s just for one class of errors.
We are sensitive to the sentiment you’re attempting to communicate, but the details matter. We can’t read your mind and are empathetic to the challenges that being a non-native English speaker presents, but without concrete requirements it’s very difficult for us to move forward. Additionally, asking us to run different compilers and compare output ourselves instead of running the commands yourself can be interpreted as you wanting others to do an outsized amount of work to, again, end up with a potential solution that doesn’t fit your requirements.
Closing for now. If you have more concrete requirements you’d like to communicate, feel free to do so. Thanks.