From b86fae041baff7a7077c67060bc4282d78a2118b Mon Sep 17 00:00:00 2001 From: tbunyk Date: Tue, 5 Sep 2017 19:01:16 +0300 Subject: encoding/json: update documentation for MarshalIndent Make arguments semantics clear without the need to look for json.Indent documentation. Change-Id: If9adfe9f477a30d426ae83790b0f2578c0a809b7 Reviewed-on: https://go-review.googlesource.com/61670 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/encoding/json/encode.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/encoding/json/encode.go') diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index 141b23c6c6..9a2f841335 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -166,6 +166,8 @@ func Marshal(v interface{}) ([]byte, error) { } // MarshalIndent is like Marshal but applies Indent to format the output. +// Each JSON element in the output will begin on a new line beginning with prefix +// followed by one or more copies of indent according to the indentation nesting. func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { b, err := Marshal(v) if err != nil { -- cgit v1.3