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

Why jas donot have a default value in func RequireXXX #10

Open
codeskyblue opened this issue Nov 18, 2013 · 1 comment
Open

Why jas donot have a default value in func RequireXXX #10

codeskyblue opened this issue Nov 18, 2013 · 1 comment

Comments

@codeskyblue
Copy link

Some times default value is needed. But I have to use such code with jas.

str, err := ctx.FindString(paths...)
if err != nil {
    str = defaultStr
}

It is a little strange. Why cannot do it like that.

str := ctx.RequireDefaultString(defaultStr, paths...)
@coocood
Copy link
Owner

coocood commented Nov 18, 2013

It is a nice feature to have.

Can you implement it, write a couple of test cases and send me a pull request?

Thank you.

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

2 participants