ryanuber / go-license

Software licensing standardization library for Golang
MIT License
69 stars 15 forks source link

exported `err` variables should be of type error #18

Closed aybabtme closed 7 years ago

aybabtme commented 7 years ago

Ohai! Cool package!

This changes the ErrXxx things to be of type error. Why? It's not good practice to match errors based on their .String() value. If the package's exporter ErrXxx.. are of type string, it encourages users to do just that.

r: @ryanuber

ryanuber commented 7 years ago

Hey @aybabtme, thanks for the PR! I completely agree that the errors should be static. I think what I'll do is merge this, then bring in #15 after a rebase on top of your changes. I think we need to just break this API and defer to vendoring for those who are affected by it, since all of these changes are important. I never like breaking BC, but in go-license's case I think it is worth it. See the comments in #15 also.

aybabtme commented 7 years ago

Yeah I think breaking BC here is not big deal.