diff options
| author | Ian Lance Taylor <iant@golang.org> | 2017-11-08 07:16:07 -0800 |
|---|---|---|
| committer | Joe Tsai <joetsai@google.com> | 2017-11-08 20:34:55 +0000 |
| commit | ed3d6727661250883c3c7e9a5b60d59a01cfa42e (patch) | |
| tree | 28cca5f1cc4c21043185f6812d9db367ecdab8f9 /src/encoding/json/encode_test.go | |
| parent | 65a864a628cb9ab767fb973d82ed979d6046f4f2 (diff) | |
| download | go-ed3d6727661250883c3c7e9a5b60d59a01cfa42e.tar.xz | |
encoding/json: permit encoding uintptr as a string
Fixes #22629
Change-Id: I31e85f9faa125ee0dfd6d3c5fa89334b00d61e6e
Reviewed-on: https://go-review.googlesource.com/76530
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Joe Tsai <joetsai@google.com>
Diffstat (limited to 'src/encoding/json/encode_test.go')
| -rw-r--r-- | src/encoding/json/encode_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/encoding/json/encode_test.go b/src/encoding/json/encode_test.go index db89d113da..0f194e13d2 100644 --- a/src/encoding/json/encode_test.go +++ b/src/encoding/json/encode_test.go @@ -71,14 +71,16 @@ func TestOmitEmpty(t *testing.T) { } type StringTag struct { - BoolStr bool `json:",string"` - IntStr int64 `json:",string"` - StrStr string `json:",string"` + BoolStr bool `json:",string"` + IntStr int64 `json:",string"` + UintptrStr uintptr `json:",string"` + StrStr string `json:",string"` } var stringTagExpected = `{ "BoolStr": "true", "IntStr": "42", + "UintptrStr": "44", "StrStr": "\"xzbit\"" }` @@ -86,6 +88,7 @@ func TestStringTag(t *testing.T) { var s StringTag s.BoolStr = true s.IntStr = 42 + s.UintptrStr = 44 s.StrStr = "xzbit" got, err := MarshalIndent(&s, "", " ") if err != nil { |
