Skip to content

Commit

Permalink
fix: address pr feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Samantha Coyle <[email protected]>
  • Loading branch information
sicoyle committed Mar 6, 2024
1 parent 5d8b40a commit 0722db7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion metadata/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ import (
)

// GetMetadataProperty returns a property from the metadata map, with support for case-insensitive keys and aliases.
func GetMetadataProperty(props map[string]string, keys ...string) (key string, val string, ok bool) {
func GetMetadataProperty(props map[string]string, keys ...string) (val string, ok bool) {
_, val, ok = GetMetadataPropertyWithMatchedKey(props, keys...)
return val, ok
}

// GetMetadataPropertyWithMatchedKey returns a property from the metadata map, with support for case-insensitive keys and aliases,
// while returning the original matching metadata field key.
func GetMetadataPropertyWithMatchedKey(props map[string]string, keys ...string) (key string, val string, ok bool) {
lcProps := make(map[string]string, len(props))
for k, v := range props {
lcProps[strings.ToLower(k)] = v
Expand Down

0 comments on commit 0722db7

Please sign in to comment.