News for hackers. Stuff that matters.
Re:Spf13 is leaving Google by herval on Monday July 18, 2022 @11:48PM (#32147332)
1 and 2 are now possible to implement, since 1.18 - I'm using this and it does save quite a bit of boilerplate: github.com/life4/genesis

I'd love to see less verbose error handling too, but Rust's ? IMHO is not the best way to go - it adds quite a bit of magic and makes debugging difficult, when a question mark at the end of a line "injects" an unexpected return statement.

Re:Spf13 is leaving Google by svnpenn on Tuesday July 19, 2022 @01:35AM (#32147896)
2 has been possible since version 1.0

https://go.dev/doc/effective_go#maps

Re:Spf13 is leaving Google by leeoniya on Monday July 18, 2022 @11:55PM (#32147365)
Re:Spf13 is leaving Google by pjmlp on Tuesday July 19, 2022 @05:06AM (#32149179)
While it won't win the hearts of Gophers, I would use a utility function that panics if error, at least on throw away code.
Re:Spf13 is leaving Google by yakubin on Tuesday July 19, 2022 @08:32AM (#32150567)
There are some instances of it in the stdlib, e.g. <https://pkg.go.dev/html/[email protected]#Must>

I'd guess with generics we can expect a generic "Must" to replace them.