diff options
| author | Petter Rasmussen | 2016-01-23 10:57:13 +0100 | 
|---|---|---|
| committer | Petter Rasmussen | 2016-01-23 10:57:13 +0100 | 
| commit | 4e0cf6011e0da8bbaa9b9b63ea347e4dc59b9ca3 (patch) | |
| tree | 535428e764751b512cf6729c689d73b953678cfb /cli/parser.go | |
| parent | 379c198883530b944c3b61d7b342bdad6d995163 (diff) | |
| download | gdrive-4e0cf6011e0da8bbaa9b9b63ea347e4dc59b9ca3.tar.bz2 | |
Prevent mutation of input values
Diffstat (limited to 'cli/parser.go')
| -rw-r--r-- | cli/parser.go | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/cli/parser.go b/cli/parser.go index 50bd0bd..5fbbe3f 100644 --- a/cli/parser.go +++ b/cli/parser.go @@ -330,7 +330,7 @@ func flagKeyValueMatch(key string, values []string, index int) ([]string, string      if values[index] == key {          value := values[index + 1] -        remaining := append(values[:index], values[index + 2:]...) +        remaining := append(copySlice(values[:index]), values[index + 2:]...)          return remaining, value, true      } @@ -343,7 +343,7 @@ func flagKeyMatch(key string, values []string, index int) ([]string, bool) {      }      if values[index] == key { -        remaining := append(values[:index], values[index + 1:]...) +        remaining := append(copySlice(values[:index]), values[index + 1:]...)          return remaining, true      } | 
