Skip to content

Commit 12832d2

Browse files
use doublestar instead of zglob for file globbing
1 parent 4d90ebc commit 12832d2

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/leonid-shevtsov/split_tests
22

33
go 1.14
44

5-
require github.com/mattn/go-zglob v0.0.0-20170124115757-95345c4e1c0e
5+
require github.com/bmatcuk/doublestar v1.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github.com/mattn/go-zglob v0.0.0-20170124115757-95345c4e1c0e h1:MjZj0KCx7aFNToMEqvMJB0IE+PpRi/goV1RC4NPfy4A=
2-
github.com/mattn/go-zglob v0.0.0-20170124115757-95345c4e1c0e/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
1+
github.com/bmatcuk/doublestar v1.3.0 h1:1jLE2y0VpSrOn/QR9G4f2RmrCtkM3AuATcWradjHUvM=
2+
github.com/bmatcuk/doublestar v1.3.0/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=

split_tests.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strconv"
88
"strings"
99

10-
zglob "github.com/mattn/go-zglob"
10+
"github.com/bmatcuk/doublestar"
1111
)
1212

1313
var useCircleCI bool
@@ -148,7 +148,13 @@ func parseFlags() {
148148
func main() {
149149
parseFlags()
150150

151-
currentFiles, _ := zglob.Glob(testFilePattern)
151+
// We are not using filepath.Glob,
152+
// because it doesn't support '**' (to match all files in all nested directories)
153+
currentFiles, err := doublestar.Glob(testFilePattern)
154+
if err != nil {
155+
printMsg("failed to enumerate current file set: %v", err)
156+
os.Exit(1)
157+
}
152158
currentFileSet := make(map[string]bool)
153159
for _, file := range currentFiles {
154160
currentFileSet[file] = true

0 commit comments

Comments
 (0)