diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-20 18:07:41 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-22 10:28:12 +0100 |
commit | 9421380168f66620cb73203e1267814b3086d805 (patch) | |
tree | 0946c9982ebfd61bb74268e69302e2364171d6f2 /Gopkg.lock | |
parent | 5d03086981b4a7d4bc450269a6a2e0fd22dbeed7 (diff) |
resource: Add Match and GetMatch
These methods takes a glob pattern as argument:
* by default matching from the bundle root
* matching is case insensitive and the separator is Unix style slashes: "/"
* the bundle root does (by default) not start with a leading slash
* if you renames the `Name` for the rsource in front matter (`src=...`), then that is the value used in `Match`.
* double asterisk matches beyond directory borders, so "**.jpg" will match any JPEG image in the bundle
See https://github.com/gobwas/glob
This commit also deprecates `ByPrefix` and `GetByPrefix`.
This should also be more effective, given a fair amount of reuse of the glob patterns:
```bash
BenchmarkResourcesByPrefix-4 300000 4284 ns/op 1130 B/op 7 allocs/op
BenchmarkResourcesMatch-4 300000 5220 ns/op 505 B/op 3 allocs/op
```
Fixes #4301
Diffstat (limited to 'Gopkg.lock')
-rw-r--r-- | Gopkg.lock | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Gopkg.lock b/Gopkg.lock index db9ec78dc..e7d14c5e3 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -98,6 +98,21 @@ version = "v1.4.7" [[projects]] + name = "github.com/gobwas/glob" + packages = [ + ".", + "compiler", + "match", + "syntax", + "syntax/ast", + "syntax/lexer", + "util/runes", + "util/strings" + ] + revision = "bea32b9cd2d6f55753d94a28e959b13f0244797a" + version = "v0.2.2" + +[[projects]] name = "github.com/gorilla/websocket" packages = ["."] revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" @@ -366,6 +381,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "398d769bcbce6e8fa04f7afab14eb64d25aed5b581d7bd39294014351a459890" + inputs-digest = "3bd32a09fb219b2cddf0e5a91110430a05bfd2d3a28215c69b8013ff2b6b89dc" solver-name = "gps-cdcl" solver-version = 1 |