mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
reflect: add Type.Bits method, add tags to prohibit conversions
gob: substitute slice for map R=r CC=golang-dev https://golang.org/cl/1699045
This commit is contained in:
parent
2fc0b4f01b
commit
fc090a3a54
9 changed files with 112 additions and 144 deletions
|
|
@ -588,7 +588,7 @@ func (d *decodeState) literal(v reflect.Value) {
|
|||
v.Set(n)
|
||||
|
||||
case *reflect.FloatValue:
|
||||
n, err := strconv.AtofN(s, int(v.Type().Size()*8))
|
||||
n, err := strconv.AtofN(s, v.Type().Bits())
|
||||
if err != nil || v.Overflow(n) {
|
||||
d.saveError(&UnmarshalTypeError{"number " + s, v.Type()})
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue