tinkerbell / tink

Workflow Engine for provisioning Bare Metal
https://tinkerbell.org
Apache License 2.0
913 stars 134 forks source link

Style issue with error strings #56

Closed alexellis closed 4 years ago

alexellis commented 4 years ago

According to idiomatic Golang style, error strings should not begin with a capital letter.

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.

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

Almost all of the error strings found in the workflow engine do not follow this rule:

https://github.com/tinkerbell/tink/blob/master/executor/executor.go#L26 https://github.com/tinkerbell/tink/blob/master/executor/executor.go#L89

I don't know where it is on the list, but perhaps going forward it might be worth following for new code and when making changes? cc @nathangoulding @deitch

golint may find this.

deitch commented 4 years ago

Some are correct, e.g. https://github.com/tinkerbell/tink/blob/master/executor/executor.go#L61 but @alexellis is correct. We should be running golint and go vet and fmtcheck as part of CI.

I will open separate issues.

alexellis commented 4 years ago

👍