Skip to content

Commit

Permalink
fix nested conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoroshko committed May 31, 2020
1 parent 196b222 commit 10fe017
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions flag_string_slice.go
Expand Up @@ -117,11 +117,10 @@ func (f *StringSliceFlag) GetValue() string {
// Apply populates the flag given the flag set and environment
func (f *StringSliceFlag) Apply(set *flag.FlagSet) error {

if f.Destination != nil {
if f.Value != nil {
f.Destination.slice = make([]string, len(f.Value.slice))
copy(f.Destination.slice, f.Value.slice)
}
if f.Destination != nil && f.Value != nil {
f.Destination.slice = make([]string, len(f.Value.slice))
copy(f.Destination.slice, f.Value.slice)

}

if val, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok {
Expand Down

0 comments on commit 10fe017

Please sign in to comment.