From d6fd4837fe57e96df2bbb9423f01f256d6f7d02a Mon Sep 17 00:00:00 2001 From: Sascha Falk Date: Wed, 30 Oct 2019 15:37:16 +0100 Subject: [PATCH] Fix variable shadowing issue in setValueForParsers() --- argumentParser.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/argumentParser.go b/argumentParser.go index 089f2c5..320e85e 100644 --- a/argumentParser.go +++ b/argumentParser.go @@ -8,19 +8,17 @@ package flaggy // as we find a parser that accepts it. func setValueForParsers(key string, value string, parsers ...ArgumentParser) (bool, error) { - var valueWasSet bool - for _, p := range parsers { valueWasSet, err := p.SetValueForKey(key, value) if err != nil { return valueWasSet, err } if valueWasSet { - break + return true, nil } } - return valueWasSet, nil + return false, nil } // ArgumentParser represents a parser or subcommand