Qi Xiao
1c133f6979
util: Change the API of WithTempDir and InTempDir.
...
They have been renamed to TestDir and InTestDir, and instead of taking a
callback, they return a cleanup function. This saves one level of
indentation in the caller.
2018-10-13 14:04:13 +01:00
Qi Xiao
81617e8ef2
Fix minor issues found by gofmt, go vet, and misspell.
2017-12-14 01:28:07 +00:00
Qi Xiao
08299115e1
glob: Fix logics for isDrive on Windows.
2017-12-09 02:58:27 +00:00
Qi Xiao
48d576ff73
glob: Fix build.
2017-12-09 02:56:56 +00:00
Qi Xiao
ca9f053af1
glob: Make drive letters somewhat work on Windows.
2017-12-09 02:55:36 +00:00
Qi Xiao
49f7f8ecf5
glob: Make code more compact and add comments.
2017-12-09 02:47:07 +00:00
Qi Xiao
ca60a5842f
glob: Improve comments and internal function names.
2017-12-09 00:52:13 +00:00
Qi Xiao
3aa100715c
glob: A trivial cleanup.
2017-12-08 00:36:18 +00:00
Qi Xiao
4af648a38f
glob: Fix test case (but not implementation yet).
2017-12-05 23:27:50 +00:00
Qi Xiao
7727601313
Add a helper function for testing in a tempdir.
2017-05-23 05:40:49 +01:00
Qi Xiao
3d001ead25
In tests that chdir, remember to go back.
2017-05-23 05:27:48 +01:00
Qi Xiao
106600a7da
Fix misspellings.
2017-05-21 23:57:57 +01:00
Qi Xiao
910610f583
Make golint slightly happier.
2017-05-21 23:54:04 +01:00
Qi Xiao
fc411c9c76
Support character sets, ranges and classes in wildcard modifiers.
...
This fixes #298 .
2017-02-02 15:24:08 -08:00
Qi Xiao
43590f1709
Rename the modifier again to match-hidden.
2017-02-02 13:54:22 -08:00
Qi Xiao
f2a58f53ca
Make glob.Segment an interface.
2017-02-02 11:15:42 -08:00
Qi Xiao
f8a50bf455
glob: Add tests.
2016-10-13 17:12:29 +08:00
Qi Xiao
4d7d8d8911
util.RootStar -> FullNames
2016-10-13 17:02:42 +08:00
Qi Xiao
8e24c0501d
Eliminate leading / in glob result of patterns like /usr/*.
...
This fixes #245 .
2016-10-10 20:18:10 +08:00
Qi Xiao
3cdc462dda
glob/parse_test.go: Fix a wrong call to Errorf.
2016-10-09 23:18:27 +08:00
Qi Xiao
d69530f8b4
Globbing is now interruptable!
2016-06-28 23:08:15 +02:00
Qi Xiao
2fa0abd26f
glob: Treat non-wildcard components specially.
...
This fixes #157 .
2016-03-21 02:12:07 +01:00
Qi Xiao
cea7d7675c
Implement an "all" modifier for wildcards; fix tests.
2016-02-23 02:45:35 +01:00
Qi Xiao
ce96ee1489
glob: Wildcards after / no longer match dot.
2016-02-23 02:34:20 +01:00
Qi Xiao
4d567f406f
Fix ~/* in a pretty hacky way.
...
This fixes #134 .
2016-02-22 16:05:14 +01:00
Qi Xiao
903de40d60
glob: More test cases.
2016-02-17 00:44:35 +01:00
Qi Xiao
5db90fd20f
Merge *util packages into an util package.
2016-02-16 19:15:29 +01:00
Qi Xiao
82e33afd34
glob: Remove unused func.
2016-02-09 00:05:34 +01:00
Qi Xiao
82bcc20ff6
Move rootNames to osutil and export it.
2016-02-09 00:05:34 +01:00
Qi Xiao
762e778eeb
glob: Add test cases against absolute paths.
2016-02-09 00:05:34 +01:00
Qi Xiao
8125e2f9e6
golint fixes.
2016-02-07 23:23:16 +01:00
Qi Xiao
be2856d882
Fix package doc of glob.
2016-02-07 22:17:02 +01:00
Qi Xiao
a6b38b1c89
Fix glob.match, add tests.
2016-02-07 19:45:57 +01:00
Qi Xiao
45674ba708
Add package glob.
2016-02-07 19:33:57 +01:00