Commit 7c7cecc1 authored by Dave Brophy's avatar Dave Brophy Committed by Rob Pike
Browse files

fmt: fix incorrect format of whole-number floats when using %#v

This fixes the unwanted behaviour where printing a zero float with the
#v fmt verb outputs "0" - e.g. missing the trailing decimal. This means
that the output would be interpreted as an int rather than a float when
parsed as Go source. After this change the the output is "0.0".

Fixes #26363

Change-Id: Ic5c060522459cd5ce077675d47c848b22ddc34fa
GitHub-Last-Rev: adfb061363f0566acec134c81be9a3dcb1f4cac8
GitHub-Pull-Request: golang/go#26383
Reviewed-on: https://go-review.googlesource.com/123956


Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
Reviewed-by: default avatarRob Pike <r@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent cb7f9ec4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment