News for hackers. Stuff that matters.
Re:Things Go needs more than generics by vaylian on Monday October 04, 2021 @08:30AM (#28745808)
> An unwrap() is a dev explicitly saying this should always contain a value

Isn't expect() supposed to cover that case?

Re:Things Go needs more than generics by rowanG077 on Monday October 04, 2021 @09:09AM (#28746206)
No it's the opposite. Unwrap() means the dev said this will never not be set. Expect() is saying if this value is not available exit the program with this user facing error message.
Re:Things Go needs more than generics by ModernMech on Monday October 04, 2021 @09:12AM (#28746235)
expect() is like unwrap() but you can give a message as an argument.