结构体支持序列化输出
This commit is contained in:
5
json.go
5
json.go
@ -100,9 +100,10 @@ func (oj *ownJSON) ConsoleOutput(data interface{}) {
|
||||
fallthrough
|
||||
case reflect.Map:
|
||||
fallthrough
|
||||
case reflect.Struct:
|
||||
fallthrough
|
||||
case reflect.Ptr:
|
||||
byteData, _ := json.Marshal(data)
|
||||
_ = json.Indent(&out, []byte(string(byteData)+"\n"), "", "\t")
|
||||
_ = json.Indent(&out, []byte(oj.MarshalForString(data)+"\n"), "", "\t")
|
||||
_, _ = out.WriteTo(os.Stdout)
|
||||
return
|
||||
case reflect.Int:
|
||||
|
Reference in New Issue
Block a user