formatFormFieldValue renders a JSON-unmarshalled value as a multipart form field string. float64 is handled specially: fmt's default %v/%g switches to scientific notation for values >= ~1e6 (e.g. "1.185356e+06"), which some backends reject when parsing the field as an integer. Use decimal notation i
(v any)
| 148 | // instead so size / block_num / offset-style numeric fields round-trip cleanly. |
| 149 | // All other types fall through to %v. |
| 150 | func formatFormFieldValue(v any) string { |
| 151 | if n, ok := v.(float64); ok { |
| 152 | return strconv.FormatFloat(n, 'f', -1, 64) |
| 153 | } |
| 154 | return fmt.Sprintf("%v", v) |
| 155 | } |
no outgoing calls