Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename errors to conform to Go style #168

Merged
merged 2 commits into from Jan 14, 2019
Merged

Conversation

fhs
Copy link
Contributor

@fhs fhs commented Jan 12, 2019

Renaming was done by gorename, so should be correct.

$ staticcheck -checks ST1012
fsys.go:52:2: error var Eperm should have name of the form ErrFoo (ST1012)
fsys.go:53:2: error var Eexist should have name of the form ErrFoo (ST1012)
fsys.go:54:2: error var Enotdir should have name of the form ErrFoo (ST1012)
xfid.go:19:5: error var Edel should have name of the form ErrFoo (ST1012)
xfid.go:20:5: error var Ebadctl should have name of the form ErrFoo (ST1012)
xfid.go:21:5: error var Ebadaddr should have name of the form ErrFoo (ST1012)
xfid.go:22:5: error var Eaddr should have name of the form ErrFoo (ST1012)
xfid.go:23:5: error var Einuse should have name of the form ErrFoo (ST1012)
xfid.go:24:5: error var Ebadevent should have name of the form ErrFoo (ST1012)

fhs and others added 2 commits January 12, 2019 15:58
Renaming was done by gorename, so should be correct.
```
$ staticcheck -checks ST1012
fsys.go:52:2: error var Eperm should have name of the form ErrFoo (ST1012)
fsys.go:53:2: error var Eexist should have name of the form ErrFoo (ST1012)
fsys.go:54:2: error var Enotdir should have name of the form ErrFoo (ST1012)
xfid.go:19:5: error var Edel should have name of the form ErrFoo (ST1012)
xfid.go:20:5: error var Ebadctl should have name of the form ErrFoo (ST1012)
xfid.go:21:5: error var Ebadaddr should have name of the form ErrFoo (ST1012)
xfid.go:22:5: error var Eaddr should have name of the form ErrFoo (ST1012)
xfid.go:23:5: error var Einuse should have name of the form ErrFoo (ST1012)
xfid.go:24:5: error var Ebadevent should have name of the form ErrFoo (ST1012)
```
Copy link
Owner

@rjkroege rjkroege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. We have established a pattern here for defining the errors for a file of code in a var block. This seems like a good convention. I hope that I remember it. 😊

@rjkroege rjkroege merged commit 846af7b into rjkroege:master Jan 14, 2019
@fhs fhs deleted the error-names branch January 14, 2019 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants