-
Notifications
You must be signed in to change notification settings - Fork 101
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
Use google go linter #50
Comments
+1 |
Thank you for the suggestion. |
Okay. But I have currently a problem using qbs for my models. Currently the id fields of a struct must be "Id" when using qbs. Can you add an exceptional case for ID? |
It does not have break the api if both methods are possible. |
I think adding extra APIs or special case just for golint is not worth it. |
most packages provide an aliasing feature with go tags ( this is not "hacking for coding style" its also to allow using existing database schemes etc. I know that qbs provides an optional function for rename magic, but this feature would be much cleaner. Maybe this would be an acceptable option for you. |
I've written a small library to solve this problem. Maybe it is useful for some other users who wants to code without golint warnings. |
Neat solution. |
Thx. You can use it like this: qbs.ColumnNameToFieldName = snaker.SnakeToCamel
qbs.FieldNameToColumnName = snaker.CamelToSnake |
I suggest that the source code get's linted with https://github.com/golang/lint
According to the linter, it is for example necessary to name all methods that contain the keyword
id
uppercase, for examplegetId
must begetID
and so on.here is a complete list of those uppercase keywords: https://github.com/golang/lint/blob/master/lint.go#L656
The text was updated successfully, but these errors were encountered: