Error Handling No-Goes In Go

from blog Brain Baking, | ↗ original
I came across a weird function in our Go codebase the other day. It was supposed to do just one thing but accidentally did a bit more—you know how this goes. Suppose you’re validating some business rule and need to fetch a bit of data to do so: func (s *Service) IsPeriodInvoicable(ref EntityRef) (bool, string, string, error) { beginP, err :=...