Remix.run Logo
linhan_dot_dev 4 days ago

I like the Go language because it's straightforward and clear, even if it looks a bit plain.

I hope the feature mentioned in the article will cause a compiler error.

However, I wouldn't use this approach when writing my own code.

eru 4 days ago | parent | next [-]

> I hope the feature mentioned in the article will cause a compiler error.

Read the article. It won't.

At best you can perhaps find a linter that'll report it?

> However, I wouldn't use this approach when writing my own code.

You might use it by accident.

linhan_dot_dev 4 days ago | parent [-]

I know, so this is a wish. Looking at other comment sections, there are actually linters that can warn about such behavior.

linhan_dot_dev 4 days ago | parent | prev | next [-]

I tested the tool more thoroughly using a strict method to review the code, but it couldn't find the problems mentioned in the article.

golangci-lint run --enable-all --max-issues-per-linter=0 --max-same-issues=0

linhan_dot_dev 4 days ago | parent | prev [-]

This comment unexpectedly received a few downvotes, which might be due to some misunderstanding. My point is as follows: 1. People choose Go for various reasons. 2. Beginners will encounter the issues mentioned in the article, so I hope there could be a feature that provides hints for newcomers. While the compilation errors might not be reasonable, at least the LSP/linter could provide some guidance.

tsimionescu 4 days ago | parent [-]

This may be a language issue, but saying "I hope this causes a compilation failure" implies that you don't know if it does - this is probably why you got down voted, since the article very explicitly says that this doesn't cause compilation failure. You may have meant that you hoped it wouldn't do this - in that case you should have used a construction like "I'd hoped this would have caused a compilation failure".

linhan_dot_dev 3 days ago | parent [-]

Thank you so much for your reply! Your advice has been really helpful. I was confused about this.