From 0efcb24c37c30dde7f5476279dc2451a1af481ce Mon Sep 17 00:00:00 2001 From: Alexandru Grigore Date: Sun, 9 Nov 2025 21:41:45 +0200 Subject: [PATCH] commands: newDocsHelper encode integers as ints in generated YAML Previously the JSON -> map roundtrip produced float64 values which caused the YAML encoder to emit integers like 404.0 instead of 404. Use the YAML encoder option yaml.AutoInt() so numbers that are integer-valued are encoded as integers. This change affects the ewDocsHelper command (commands/gen.go) where the docs data is written to docs/data/docs.yaml. After this change generated YAML will contain integer values (e.g. status: 404) instead of floats (e.g. status: 404.0). Fixes #14122 --- commands/gen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/gen.go b/commands/gen.go index 993eac53c..5579b7554 100644 --- a/commands/gen.go +++ b/commands/gen.go @@ -249,7 +249,7 @@ url: %s return err } defer f.Close() - yamlEnc := yaml.NewEncoder(f) + yamlEnc := yaml.NewEncoder(f, yaml.AutoInt()) if err := yamlEnc.Encode(m); err != nil { return err } -- 2.39.5