1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

Store floating point number without decimal places.

Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
Signed-off-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Felix Fontein
2025-07-28 22:00:48 +02:00
committed by GitHub
parent 23cd77d15c
commit c30e36ea76

View File

@@ -278,7 +278,7 @@ func EncodeNonStrings(m map[string]interface{}) {
// The JSON unserializer treats every number as a float, so the above 'if'
// never applies in that situation.
if vFloat, ok := v.(float64); ok {
m["shamir_threshold"] = fmt.Sprintf("%g", vFloat)
m["shamir_threshold"] = fmt.Sprintf("%.0f", vFloat)
}
}
}