aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/encoding/json/encode.go
diff options
context:
space:
mode:
authorDavid Symonds <dsymonds@golang.org>2012-02-28 11:41:16 +1100
committerDavid Symonds <dsymonds@golang.org>2012-02-28 11:41:16 +1100
commit9dd746c4cb09b65128d0dd432b58c324151910bf (patch)
tree0beed9b1eab7b467fd4aa6610d843a3fee74d1d8 /src/pkg/encoding/json/encode.go
parent740d5038667d385f99eb42d54381b330390f0417 (diff)
downloadgo-9dd746c4cb09b65128d0dd432b58c324151910bf.tar.xz
encoding/json: drop MarshalForHTML; gofix calls to Marshal.
I've elected to omit escaping the output of Marshalers for now. I haven't thought through the implications of that; I suspect that double escaping might be the undoing of that idea. Fixes #3127. R=golang-dev, r CC=golang-dev https://golang.org/cl/5694098
Diffstat (limited to 'src/pkg/encoding/json/encode.go')
-rw-r--r--src/pkg/encoding/json/encode.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/pkg/encoding/json/encode.go b/src/pkg/encoding/json/encode.go
index 8a794b79bd..7f5deed94d 100644
--- a/src/pkg/encoding/json/encode.go
+++ b/src/pkg/encoding/json/encode.go
@@ -123,17 +123,6 @@ func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
return buf.Bytes(), nil
}
-// MarshalForHTML is like Marshal but applies HTMLEscape to the output.
-func MarshalForHTML(v interface{}) ([]byte, error) {
- b, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- var buf bytes.Buffer
- HTMLEscape(&buf, b)
- return buf.Bytes(), nil
-}
-
// HTMLEscape appends to dst the JSON-encoded src with <, >, and &
// characters inside string literals changed to \u003c, \u003e, \u0026
// so that the JSON will be safe to embed inside HTML <script> tags.