summaryrefslogtreecommitdiff
path: root/src/pkg/json/encode.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-06-20 12:16:25 -0700
committerRuss Cox <rsc@golang.org>2010-06-20 12:16:25 -0700
commitbe1fb301f118bbbf0cc9564f72392390425b5c67 (patch)
tree6858bcb73f10fcafb2b153875c318462b35a6c53 /src/pkg/json/encode.go
parent91b42e59afb95e7ff63ec1bee1c2a322b6848d66 (diff)
downloadgolang-be1fb301f118bbbf0cc9564f72392390425b5c67.tar.gz
reflect: add Kind, remove Int8Type, Int8Value, etc.
update other code to match. R=r CC=golang-dev http://codereview.appspot.com/1680044
Diffstat (limited to 'src/pkg/json/encode.go')
-rw-r--r--src/pkg/json/encode.go24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/pkg/json/encode.go b/src/pkg/json/encode.go
index 839657c36..8b0f78488 100644
--- a/src/pkg/json/encode.go
+++ b/src/pkg/json/encode.go
@@ -156,35 +156,13 @@ func (e *encodeState) reflectValue(v reflect.Value) {
}
case *reflect.IntValue:
- e.WriteString(strconv.Itoa(v.Get()))
- case *reflect.Int8Value:
- e.WriteString(strconv.Itoa(int(v.Get())))
- case *reflect.Int16Value:
- e.WriteString(strconv.Itoa(int(v.Get())))
- case *reflect.Int32Value:
- e.WriteString(strconv.Itoa(int(v.Get())))
- case *reflect.Int64Value:
e.WriteString(strconv.Itoa64(v.Get()))
case *reflect.UintValue:
- e.WriteString(strconv.Uitoa(v.Get()))
- case *reflect.Uint8Value:
- e.WriteString(strconv.Uitoa(uint(v.Get())))
- case *reflect.Uint16Value:
- e.WriteString(strconv.Uitoa(uint(v.Get())))
- case *reflect.Uint32Value:
- e.WriteString(strconv.Uitoa(uint(v.Get())))
- case *reflect.Uint64Value:
e.WriteString(strconv.Uitoa64(v.Get()))
- case *reflect.UintptrValue:
- e.WriteString(strconv.Uitoa64(uint64(v.Get())))
case *reflect.FloatValue:
- e.WriteString(strconv.Ftoa(v.Get(), 'g', -1))
- case *reflect.Float32Value:
- e.WriteString(strconv.Ftoa32(v.Get(), 'g', -1))
- case *reflect.Float64Value:
- e.WriteString(strconv.Ftoa64(v.Get(), 'g', -1))
+ e.WriteString(strconv.FtoaN(v.Get(), 'g', -1, int(v.Type().Size()*8)))
case *reflect.StringValue:
e.string(v.Get())