From: Russ Cox Date: Fri, 11 Nov 2016 16:06:32 +0000 (-0500) Subject: encoding/json: document what happens to MarshalText's result X-Git-Tag: go1.8beta1~85 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9073af247d602dff4633710adf90c8b3c1869c45;p=gostls13.git encoding/json: document what happens to MarshalText's result Fixes #17743. Change-Id: Ib5afb6248bb060f2ad8dd3d5f78e95271af62a57 Reviewed-on: https://go-review.googlesource.com/33135 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Quentin Smith Reviewed-by: Caleb Spare --- diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index 98a9899502..8f21ddaed9 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -34,7 +34,7 @@ import ( // and is not a nil pointer, Marshal calls its MarshalJSON method // to produce JSON. If no MarshalJSON method is present but the // value implements encoding.TextMarshaler instead, Marshal calls -// its MarshalText method. +// its MarshalText method and encodes the result as a JSON string. // The nil pointer exception is not strictly necessary // but mimics a similar, necessary exception in the behavior of // UnmarshalJSON.