支持从json -> xml的转换
This commit is contained in:
22
wrapper/json_test.go
Normal file
22
wrapper/json_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
// Package wrapper ...
|
||||
//
|
||||
// Description : wrapper ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2025-04-28 16:59
|
||||
package wrapper
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewJson(t *testing.T) {
|
||||
sourceData := `{"name": "test", "age":18,"company":{"address": "Beijing", "name":"lala"},"index":[1,2,3,4], "deep":[{"name":"a"}]}`
|
||||
instance, iErr := NewJson(sourceData)
|
||||
fmt.Println(iErr)
|
||||
res, err := instance.Marshal("xml")
|
||||
fmt.Println(err)
|
||||
fmt.Println(string(res))
|
||||
}
|
Reference in New Issue
Block a user