3 ms·
Same. I've some spots in my code where I return three or four values (there's no logical reason to put them inside a struct...) and so I end up with a handful o
by barsonme 10y ago
Same. I've some spots in my code where I return three or four values (there's no logical reason to put them inside a struct...) and so I end up with a handful of
if err != nil {
return "", 0, err
}
_all_ _over_ _the_ _place_. What I also don't like (perhaps I'm just being too uptight) is
return myStructType{}, nil
The alternative is to use a named return parameter (which usually is good form), but it's still kinda gross, especially if it's a longer package + struct name.