Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow access to source text in returned glob.Glob type #39

Open
ekinanp opened this issue Jan 21, 2020 · 0 comments
Open

Allow access to source text in returned glob.Glob type #39

ekinanp opened this issue Jan 21, 2020 · 0 comments

Comments

@ekinanp
Copy link

ekinanp commented Jan 21, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant