增加 Transition 方法
This commit is contained in:
parent
01f39b6ea0
commit
c5395eec5e
9
json.go
9
json.go
@ -114,6 +114,15 @@ func (oj *ownJSON) MarshalForString(input interface{}) string {
|
||||
return string(oj.MarshalForByte(input))
|
||||
}
|
||||
|
||||
// Transition 数据结构转换 map/slice/struct => struct | struct => map/slice/struct
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 18:25 2023/12/29
|
||||
func (oj *ownJSON) Transition(input interface{}, receiver interface{}) error {
|
||||
return oj.UnmarshalWithNumber(oj.MarshalForByte(input), receiver)
|
||||
}
|
||||
|
||||
// ConsoleOutput ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Loading…
Reference in New Issue
Block a user