gobwas / glob

Go glob
MIT License
948 stars 63 forks source link

Consecutive separator behaviour #46

Open erikgeiser opened 3 years ago

erikgeiser commented 3 years ago

As was already discussed in https://github.com/gobwas/glob/issues/20, patterns containing **/* may lead to unexpected results for most users. After porting https://github.com/goreleaser/nfpm to glob, this was reported as a regression (https://github.com/goreleaser/nfpm/issues/256).

Currently, the pattern test/**/* does not match test/file but it does match test//file (https://play.golang.org/p/geU9afuijny). While this is technically correct, it is not what users expect, since test/file and test//file are identical in the context of file systems.

This situation could be solved by modifying the AST. This could also be added as an option using the pattern described in https://github.com/gobwas/glob/issues/45.