-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
As discuses in comment we should NOT use pointers for URL struct tags.
Example :
Currently (wrong) -
go-github/github/orgs_audit_log.go
Lines 15 to 21 in e5024aa
| type GetAuditLogOptions struct { | |
| Phrase *string `url:"phrase,omitempty"` // A search phrase. (Optional.) | |
| Include *string `url:"include,omitempty"` // Event type includes. Can be one of "web", "git", "all". Default: "web". (Optional.) | |
| Order *string `url:"order,omitempty"` // The order of audit log events. Can be one of "asc" or "desc". Default: "desc". (Optional.) | |
| ListCursorOptions | |
| } |
Correct -
type GetAuditLogOptions struct {
Phrase string `url:"phrase,omitempty"`
Include string `url:"include,omitempty"`
Order string `url:"order,omitempty"`
ListCursorOptions
}Task :
- Update all URL option structs to remove pointer fields
- Update the
structfieldlinter to catch this issue going forward
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels