Go Cheatsheet - Format Errors
Errors
Return simple error string
return errors.New("Invalid Parameter")
Return string with format
return fmt.Errorf("user %q (id %d) not found", name, id)
return errors.New("Invalid Parameter")
return fmt.Errorf("user %q (id %d) not found", name, id)