ref: 4eb1650bec0be0da57947fc8ee9b3c641d5e35dd
parent: 20c9b6ec81171d1c586ea31d5d08b40b0edaffc6
author: Bjørn Erik Pedersen <[email protected]>
date: Wed Jan 17 15:47:35 EST 2018
resource: Use path.Match instead of filepath.Match They behave similar, but it is a path we're matching. See #4244
--- a/resource/resource.go
+++ b/resource/resource.go
@@ -360,7 +360,7 @@
// and matching by wildcard given in `src` using `filepath.Match` with lower cased values.
// This assignment is additive, but the most specific match needs to be first.
// The `name` and `title` metadata field support shell-matched collection it got a match in.
-// See https://golang.org/pkg/path/filepath/#Match
+// See https://golang.org/pkg/path/#Match
func AssignMetadata(metadata []map[string]interface{}, resources ...Resource) error {
counters := make(map[string]int)
@@ -390,7 +390,7 @@
srcKey := strings.ToLower(cast.ToString(src))
- match, err := filepath.Match(srcKey, resourceSrcKey)
+ match, err := path.Match(srcKey, resourceSrcKey)
if err != nil {
return fmt.Errorf("failed to match resource with metadata: %s", err)
}