You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct big.Float implemented interface Stringer from package fmt.
In according to doc package fmt:
If an operand implements method String() string, that method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any).
What did you expect to see?
User struct => Val{12,45}
Big Float 1 => 23
Big Float 2 => 23
Big Float 3 => 23
Big Float 4 => 23
Big Float 5 => 23
What did you see instead?
Result from golang platground:
User struct => Val{12,45}
Big Float 1 => %!s(*big.Float=23)
Big Float 2 => {%!s(uint32=53) %!s(big.RoundingMode=0) %!s(big.Accuracy=0) %!s(big.form=1) %!s(bool=false) [%!s(big.Word=0) %!s(big.Word=3087007744)] %!s(int32=5)}
Big Float 3 => 23
Big Float 4 => 23
Big Float 5 => 23
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?go playground
andgo 1.8.3 linux/amd64
Does this issue reproduce with the latest release?
checked only for
go playground
andgo 1.8.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?ubuntu linux x64
What did you do?
Playground:
https://play.golang.org/p/VNajWTsFQRd
Code:
Expected behavior:
struct big.Float
implemented interfaceStringer
from packagefmt
.fmt
:What did you expect to see?
What did you see instead?
Result from
golang platground
:The text was updated successfully, but these errors were encountered: