]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: allow float types to be integer literals
authorKatie Hockman <katie@golang.org>
Fri, 9 Apr 2021 19:50:40 +0000 (15:50 -0400)
committerKatie Hockman <katie@golang.org>
Mon, 12 Apr 2021 18:51:16 +0000 (18:51 +0000)
commit8b96efd8a274a65504dc9051e0545379d26f8445
tree38a1db70d8c14756400a5fff7fdb9f69e0924b28
parent88c0c2d9ea9c57eb3c5915d9e90ec59ae5a35a35
[dev.fuzz] internal/fuzz: allow float types to be integer literals

Previously, something like `float64(0)` would fail to decode
since the 0 value is considered an integer literal, and the
float64 parsing code required a float literal. Be more flexible
here since an integer can always be converted to a float.

Change-Id: Id1c53ef2e8a9748a4f71176b00b453a329af4ade
Reviewed-on: https://go-review.googlesource.com/c/go/+/309032
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/internal/fuzz/encoding.go
src/internal/fuzz/encoding_test.go