Error handling
Ideally, an error should be either handled (logged) or returned to the caller.
This is to avoid logging the same error three times in three different layers, so your dashboard does not count it three times - which looks confusing and misleading. It keeps your error stack trace clean and readable.
To handle an error: log it, apply a retry policy, or whatever fits your use case and stop there - do not return it.
To return an error: add some context to it and pass it up - do not log it. Optionally (encouraged), wrap the error with fmt.Errorf("user fetch failed: %w", err) so the original error is preserved and can be checked with errors.Is(err, ...).
This is also why Go error messages are lowercase with no punctuation at the end. They end up in the middle of another message, so it's "user fetch failed: connection reset by peer", not "User fetch failed: Connection reset by peer."
