jas icon indicating copy to clipboard operation
jas copied to clipboard

Why jas donot have a default value in func RequireXXX

Open codeskyblue opened this issue 11 years ago • 1 comments

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...)

codeskyblue avatar Nov 18 '13 02:11 codeskyblue

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.

coocood avatar Nov 18 '13 04:11 coocood