-
Notifications
You must be signed in to change notification settings - Fork 12
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
go/lint: enforce camelCase in json struct tags #275
Comments
Go doesn't have warnings, but we can probably require camelCase. Go doesn't care when reading JSON, but some languages like javascript do. We support languages besides the web, but a common standard of camelCase would be good. |
Looks like we can support this request with https://golangci-lint.run/usage/linters/#tagliatelle |
Want me to submit a PR? |
Yes, I think we can just enable the linter. By default it won't require us to have field names and struct tags match, which is probably fine. I know there are some cases where we deviate struct from json for readability. The defaults for json and yaml camelcase work for us. If we wanted to be stricter we could force I don't think we need to use a config file for this linter, so we aren't dependent on #274. |
camelCase is the capitalization preferred in JavaScript. I know JSON is read by many different languages, but having a mix of different capitalization in json struct tags isn't a good idea. We should ask authors to use camelCase.
The text was updated successfully, but these errors were encountered: