We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65be7a4 commit b78ccf3Copy full SHA for b78ccf3
1 file changed
keepsorted/options.go
@@ -233,7 +233,14 @@ func formatValue(val reflect.Value) (string, error) {
233
case reflect.TypeFor[map[string]bool]():
234
return formatList(slices.Sorted(maps.Keys(val.Interface().(map[string]bool))))
235
case reflect.TypeFor[IntOrBool]():
236
- return strconv.Itoa(int(val.Int())), nil
+ switch i := int(val.Int()); i {
237
+ case 0:
238
+ return boolString[false], nil
239
+ case 1:
240
+ return boolString[true], nil
241
+ default:
242
+ return strconv.Itoa(i), nil
243
+ }
244
case reflect.TypeFor[int]():
245
return strconv.Itoa(int(val.Int())), nil
246
case reflect.TypeFor[[]ByRegexOption]():
0 commit comments