On Wed, 19 Feb 2020 at 17:15, Mike Schinkel <m...@newclarity.net> wrote:

> From https://github.com/golang/go/wiki/CodeReviewComments#error-strings
>
> "Error strings should not be capitalized (unless beginning with proper
> nouns or acronyms) or end with punctuation, since they are usually printed
> following other context. That is, use fmt.Errorf("something bad") not
> fmt.Errorf("Something bad"), so that log.Printf("Reading %s: %v", filename,
> err) formats without a spurious capital letter mid-message. This does not
> apply to logging, which is implicitly line-oriented and not combined inside
> other messages."
>


Thanks, I can see the reasoning, although I'm not sure I agree with it.

If you're only showing it to a programmer, worrying about the grammar of a
capital letter after a colon seems needlessly pedantic. If you're showing
it to end-users, you should probably be thinking about i18n anyway, and can
load your own English translations (and user-friendly summaries) for
whatever context you want to show them in.

Regards,
-- 
Rowan Tommins
[IMSoP]

Reply via email to