-
Notifications
You must be signed in to change notification settings - Fork 312
feature: add support for URL struct tags in struct-tag rule #1239
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
Conversation
| keyJSON = "json" | ||
| keyProtobuf = "protobuf" | ||
| keyRequired = "required" | ||
| keyURL = "url" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd maybe update the docs to include all supported struct tags explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this PR is one in a series of PR related to struct-tag, I'll will update the doc at the end.
| var delimiter = "" | ||
| for _, opt := range options { | ||
| switch opt { | ||
| case "int", "omitempty", "numbered", "brackets": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we miss the following: unix, unixmilli, unixnano
Also, I'd consider adding support for layout and del struct tags, since they are a part of the spec for github.com/google/go-querystring/query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I' ve added unix* options.
layout and del : almost no-body uses them so I think it does not worth supporting these tags.
|
Thanks. Looks nice and simple. Just a few comments. |
This PR extends struct-tag rule to check URL tags as defined at https://github.com/google/go-querystring (cf https://go.dev/wiki/Well-known-struct-tags#list-of-well-known-struct-tags)