Honest to God, i agree with Alessandro Arzilli feedback.
Having a check statement near a function imho can make readability worse.
If we want to handle errors and avoid err != nil
, i would like something like this:
From:
func Foo() (err error) {
handle err { return fmt.Errorf("error: %v", err) }