调整struct

This commit is contained in:
白茶清欢 2022-05-14 15:22:53 +08:00
parent 8d84b733b8
commit 3b612857fe
2 changed files with 14 additions and 3 deletions

View File

@ -20,6 +20,8 @@ var (
JSON *ownJSON
// String ...
String *stringOperate
// Struct ...
Struct *ownStruct
)
func init() {
@ -29,4 +31,5 @@ func init() {
IP = &ip{}
JSON = &ownJSON{}
String = &stringOperate{}
Struct = &ownStruct{}
}

View File

@ -1,4 +1,4 @@
// Package util...
// Package util ...
//
// Description : util ...
//
@ -9,12 +9,20 @@ package util
import "encoding/json"
// StructToMap 结构体转为map
// ownStruct ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 15:19 2022/5/14
type ownStruct struct {
}
// ToMap 结构体转为map
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 11:12 下午 2021/3/14
func StructToMap(data interface{}) (map[string]interface{}, error) {
func (os *ownStruct) ToMap(data interface{}) (map[string]interface{}, error) {
var (
byteData []byte
err error