Skip to content

Commit

Permalink
Simplify logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaholaz committed May 13, 2024
1 parent 5ed8fd1 commit 7bc742f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ func LoadConfig(filename string, config interface{}) error {

switch field.Kind() {
case reflect.Slice:
// Create a empty slice, if no slice exists for this key already.
if field.IsNil() || lastUpdate[*key] == 0 {
if lastUpdate[*key] == 0 {
field.Set(reflect.MakeSlice(field.Type(), 0, 0))
}

Expand Down

0 comments on commit 7bc742f

Please sign in to comment.