Skip to content

Commit

Permalink
add float32 type support
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxikun committed May 25, 2018
1 parent 68d793e commit 14b44d1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions multiconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ func fieldSet(field *structs.Field, v string) error {
if err := field.Set(f); err != nil {
return err
}
case reflect.Float32:
f, err := strconv.ParseFloat(v, 32)
if err != nil {
return err
}

if err := field.Set(float32(f)); err != nil {
return err
}
case reflect.Int64:
switch t := field.Value().(type) {
case time.Duration:
Expand Down

0 comments on commit 14b44d1

Please sign in to comment.