this post was submitted on 07 Jun 2025
20 points (100.0% liked)
Golang
2495 readers
1 users here now
This is a community dedicated to the go programming language.
Useful Links:
Rules:
- Posts must be relevant to Go
- No NSFW content
- No hate speech, bigotry, etc
- Try to keep discussions on topic
- No spam of tools/companies/advertisements
- It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I agree. The syntax for useless error handling is indeed more verbose than Rust (a whole if block Vs a single
?
) but the difference when you actually do proper error handling and add a useful context message is much smaller.You could argue that's a good thing because it encourages writing proper error handling code.
I've seen plenty of Rust code with only
?
which leads to really bad error messages. I've seen Rust errors in complex programs that are literally justCould not open file or directory
- no context, no filename. Go definitely has better error messages on average.That said I still prefer Rust's error handling, and writing Rust in general.