Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-01-17 22:47:35 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-01-17 22:48:31 +0300
commit4eb1650bec0be0da57947fc8ee9b3c641d5e35dd (patch)
treebd7b27201ca8f5a143cc53802ce57f29e61645c8 /resource
parent20c9b6ec81171d1c586ea31d5d08b40b0edaffc6 (diff)
resource: Use path.Match instead of filepath.Match
They behave similar, but it is a path we're matching. See #4244
Diffstat (limited to 'resource')
-rw-r--r--resource/resource.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/resource/resource.go b/resource/resource.go
index 951f1d9a7..b3a92273d 100644
--- a/resource/resource.go
+++ b/resource/resource.go
@@ -360,7 +360,7 @@ func (l *genericResource) Publish() error {
// 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 @@ func AssignMetadata(metadata []map[string]interface{}, resources ...Resource) er
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)
}