Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
config: parse float values
  • Loading branch information
AL-CT committed Jul 22, 2025
commit a83ffd4df4565c03850466f91fc382ee582d65a0
8 changes: 8 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ func Parse(c CfgMap) error {
}
reflect.ValueOf(v.Value).Elem().SetInt(evTyped)

case reflect.Float32, reflect.Float64:
evTyped, err := strconv.ParseFloat(envValue, 64)
if err != nil {
return fmt.Errorf("invalid float for %v: %w",
k, err)
}
reflect.ValueOf(v.Value).Elem().SetFloat(evTyped)

case reflect.Uint, reflect.Uint8, reflect.Uint16,
reflect.Uint32, reflect.Uint64:

Expand Down
Loading