-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
autoflex: wire up option functions, add IgnoreFieldNames option (#36437)
This change implements AutoFlex options, allowing custom options to be passed to `flex.Expand` or `flex.Flatten`. The changes include: - Adding a new `AutoFlexOptions` struct, which stores all configurable options - Embedding the `AutoFlexOptions` struct into the `autoExpand` and `autoFlatten` flexer structs - Adjusting the `AutoFlexOptionsFunc` signature to accept a pointer to `AutoFlexOptions` As a first use case, the `IgnoreFieldNames` option was added. This option is a slice of strings, with a default value of `[]string{"Tags"}`. This replaces the previously hardcoded logic which skipped processing of any fields named `Tags`, and instead makes this configurable. Test cases have been added to exercise the behavior with default options and overrides to remove defaults and add custom values.
- Loading branch information
Showing
5 changed files
with
285 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.