4 ms·
I don't understand your problem with errors versus maps.... they're actually the exact same code pattern: val, ok := m["foo"] if !ok { // handl
by NateDad 12y ago
I don't understand your problem with errors versus maps.... they're actually the exact same code pattern:
val, ok := m["foo"]
if !ok {
// handle not found
}
// good path
and
val, err := m("foo")
if err != nil {
// handle err
}
// good path