变更 interface{} => any

This commit is contained in:
2024-06-08 20:06:35 +08:00
parent 3faebb9145
commit 588df729e0
13 changed files with 59 additions and 59 deletions

View File

@ -17,7 +17,7 @@ import (
// Author : go_developer@163.com<白茶清欢>
//
// Date : 16:07 2023/8/10
func NewStruct(data interface{}) *Struct {
func NewStruct(data any) *Struct {
s, _ := NewStructWithError(data)
return s
}
@ -27,7 +27,7 @@ func NewStruct(data interface{}) *Struct {
// Author : go_developer@163.com<白茶清欢>
//
// Date : 16:17 2023/8/10
func NewStructWithError(data interface{}) (*Struct, error) {
func NewStructWithError(data any) (*Struct, error) {
if data == nil {
return nil, errors.New("input data is nil")
}
@ -47,7 +47,7 @@ func NewStructWithError(data interface{}) (*Struct, error) {
//
// Date : 16:05 2023/8/10
type Struct struct {
data interface{}
data any
}
// ToMap 转为Map
@ -58,7 +58,7 @@ type Struct struct {
func (s *Struct) ToMap() MapResult {
if nil == s.data {
return MapResult{
Value: EasyMap(map[interface{}]interface{}{}),
Value: EasyMap(map[any]any{}),
Err: nil,
}
}