gobwas/glob

Allow access to source text in returned `glob.Glob` type

ekinanp opened this issue · 0 comments

If I do something like

g := glob.MustCompile("foo")

then I should be able to get the source text "foo" via something like g.SourceText().

Use-case: I have functions that expect a glob. It'd be nice to get compile-time type-checking by restricting those functions to accept a glob.Glob type. However, some of those functions need the source text, so I cannot currently do that. Instead, I have those functions take a string that I pass-into MustCompile -- this loses compile-time type-checking.