cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
5.03k stars 287 forks source link

file.Glob: Replace stdlib Glob to support double star syntax #1919

Open fionera opened 2 years ago

fionera commented 2 years ago

Is your feature request related to a problem? Please describe. The Go stdlib implements Glob with Match as its base and does not support the double star syntax. To allow recursive lists via file.Glob it should be supported.

Describe the solution you'd like Replace the usage of the stdlib Glob with an implementation that supports double stars like https://github.com/bmatcuk/doublestar

Describe alternatives you've considered I didnt found any good way to list all files of an extension recursively

Additional context https://stackoverflow.com/questions/26809484/how-to-use-double-star-glob-in-go https://github.com/golang/go/issues/11862

myitcv commented 2 years ago

Thanks for raising. Please can you edit the description above, filling out the template for a feature request:

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

The "Feature Request" issue type is linked from https://github.com/cue-lang/cue/issues/new/choose for convenience.

fionera commented 2 years ago

Sure thing :) I wasnt sure if this is a feature request or a bug since CUE already has a Glob feature, but doesnt implement the full spec.

myitcv commented 2 years ago

but doesnt implement the full spec.

The history behind that decision is covered in https://github.com/golang/go/issues/11862. I think we need to first reach agreement that we want to implement/use something different for CUE. And then discuss how that should be implemented.