-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/keyvaluetags: Allow KeyValueTags type passthrough in New(), …
…add unit testing, and fix potential panic (#19011) * internal/keyvaluetags: Allow KeyValueTags type passthrough in New(), add unit testing, and fix potential panic Reference: #18726 (comment) The current behavior is to return an empty `KeyValueTags` if the type is unrecognized in `New()` in preference over panicking or requiring all consumers to implement error handling. This augments `New()` to accept the named `KeyValueTags` in addition to its underlying `map[string]*TagData` type, preventing confusing behavior on an otherwise easy to miss resource/service implementation detail. Added unit testing to cover various `New()` type scenarios. Fixed panic discovered while implementing the unit testing. * internal/keyvaluetags: Ensure New() of KeyValueTags named and underlying types are copies
- Loading branch information
Showing
2 changed files
with
169 additions
and
12 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