remove redundant clause in string_slice_flag

This commit is contained in:
zhiming 2021-06-29 09:09:08 +08:00 committed by GitHub
parent abf6584322
commit ab4918b6bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,7 @@ func (s *StringSlice) Set(val string) error {
if s.value == nil {
return fmt.Errorf("no target (nil pointer to []string)")
}
if *s.value == nil || !s.changed {
if !s.changed {
*s.value = make([]string, 0)
}
*s.value = append(*s.value, val)