Repository: bytedance/sonic (go)

Issue:
能否添加一个MarshalIndent在根方法那里？
现在的标准库有 `json.MarshalIndent` 这个方法，sonic要通过设定一个config才能使用`sonic.ConfigStd.MarshalIndent`，能否与标准包的方法保持一致？



Pull request:
chore: export MarshalIndent api in root
Fix #665 

Patch:
diff --git a/api.go b/api.go
index 0933291..ef9f8ef 100644
--- a/api.go
+++ b/api.go
@@ -157,6 +157,13 @@ func Marshal(val interface{}) ([]byte, error) {
     return ConfigDefault.Marshal(val)
 }
 
+// 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) {
+    return ConfigDefault.MarshalIndent(v, prefix, indent)
+}
+
 // MarshalString returns the JSON encoding string of v.
 func MarshalString(val interface{}) (string, error) {
     return ConfigDefault.MarshalToString(val)


Test patch:
diff --git a/api_test.go b/api_test.go
index 04ec727..ee81632 100644
--- a/api_test.go
+++ b/api_test.go
@@ -49,3 +49,21 @@ func TestValid(t *testing.T) {
         require.Equal(t, tc.expected, Valid([]byte(tc.data)), tc.data)
     }
 }
+
+
+func TestIdent(t *testing.T) {
+    foo := struct {
+        Name string
+        Age  int
+    }{
+        Name: "sonic",
+        Age:  20,
+    }
+
+    out, err := MarshalIndent(&foo, "", "  ")
+    require.Nil(t, err)
+    require.Equal(t, `{
+  "Name": "sonic",
+  "Age": 20
+}`, string(out))
+}