Skip to content
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

internal/keyvaluetags: Allow KeyValueTags type passthrough in New(), add unit testing, and fix potential panic #19011

Merged
merged 2 commits into from
Apr 20, 2021

Commits on Apr 20, 2021

  1. 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.
    bflad committed Apr 20, 2021
    Configuration menu
    Copy the full SHA
    65d7f3b View commit details
    Browse the repository at this point in the history
  2. internal/keyvaluetags: Ensure New() of KeyValueTags named and underly…

    …ing types are copies
    bflad committed Apr 20, 2021
    Configuration menu
    Copy the full SHA
    c5bc89b View commit details
    Browse the repository at this point in the history