Skip to content

Commit

Permalink
fix(commonjs): Substitute doublestar for zglob to fix data race
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed Jan 31, 2018
1 parent c7d449d commit b16e851
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
17 changes: 7 additions & 10 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@
[[constraint]]
branch = "v2"
name = "gopkg.in/yaml.v2"

[[constraint]]
name = "github.com/gobwas/glob"
version = "0.2.2"

[[constraint]]
name = "github.com/bmatcuk/doublestar"
version = "1.0.9"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif
.PHONY: default

default:
GOBIN=${GOBIN} go install -ldflags '-race -X main.revision=$(shell git rev-parse HEAD)' github.com/fossas/fossa-cli/cmd/fossa
GOBIN=${GOBIN} go install -ldflags '-X main.revision=$(shell git rev-parse HEAD)' github.com/fossas/fossa-cli/cmd/fossa

clean:
rm -f $(GOPATH)/bin/fossa
4 changes: 2 additions & 2 deletions build/commonjs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"sync"

"github.com/mattn/go-zglob"
"github.com/bmatcuk/doublestar"

"github.com/fossas/fossa-cli/log"
)
Expand Down Expand Up @@ -191,7 +191,7 @@ func (ctx *CommonJSContext) traverseNodeModules(m *Module) ([]Dependency, error)
return nil, err
}

commonjsPkgs, err := zglob.Glob(filepath.Join(cwd, m.Dir) + "/**/node_modules/*/package.json")
commonjsPkgs, err := doublestar.Glob(filepath.Join(cwd, m.Dir) + "/**/node_modules/*/package.json")
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b16e851

Please sign in to comment.