增加 Transition 方法

This commit is contained in:
白茶清欢 2023-12-29 18:26:59 +08:00
parent 01f39b6ea0
commit c5395eec5e
1 changed files with 9 additions and 0 deletions

View File

@ -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<白茶清欢>