an option name (e.g. "--foo"), if it finds a match, it returns both the
subsequent option value and the argument array with those two elements
removed. When I do this with the following one liner:
return true, args[i+1], append(args[:i], args[i+2:]...)
I'm getting the argument at index [i+1] AFTER the removal of the two
elements, which is not what I intended. The following fixes the issue:
value := args[i+1]
return true, value, append(args[:i], args[i+2:]...)
Are arguments to return evaluated from right to left in general, or is this
a special case with `append`?
Thanks,
Nathan
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.