Skip to content

Commit a7c2d82

Browse files
committed
fix: treat empty values as nil slice
1 parent 181f5f4 commit a7c2d82

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

envconfig.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ func parseInt(inp reflect.Value, value string, base, bitSize int) error {
385385
}
386386

387387
func split(s string) []string {
388+
if s == "" {
389+
return nil
390+
}
391+
388392
raw := strings.Split(s, ",")
389393
out := make([]string, 0, len(raw))
390394
for _, it := range raw {

0 commit comments

Comments
 (0)