spdx / tools-golang

Collection of Go packages to work with SPDX files
Other
116 stars 54 forks source link

Error string should not be capitalized or end with the punctuation mark #216

Open lumjjb opened 1 year ago

lumjjb commented 1 year ago

Opening this issue here from stale PR #178, opened by @CatalinStratu .

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.

Source: https://github.com/golang/go/wiki/CodeReviewComments#error-strings