Subscribe
Share
Share
Embed
I talk about error handling in Go, why I think it's good but after a little bit of time getting used to have error as values.
try {
if (user.HasAccessTo(Admin) {
if (somethingElse()) {
// happy path
}
else {}
}
else {}
}
catch(Exception ex) {
// what really happened, and where?
}
ok, error := hasAccessTo(user, ADMIN)
if err != nil || !ok {
// handle not access
}
15 minutes news, tips, and tricks on the Go programming language.