1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

refactor: remove struct_internal.go

This commit is contained in:
dudaodong
2024-01-29 10:02:36 +08:00
parent 66dfd9c4fd
commit a630a7cda9
2 changed files with 2 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
package structs
import (
"fmt"
"reflect"
"github.com/duke-git/lancet/v2/pointer"
@@ -61,7 +62,7 @@ func New(value any, tagName ...string) *Struct {
// ToMap convert the exported fields of a struct to map.
func (s *Struct) ToMap() (map[string]any, error) {
if !s.IsStruct() {
return nil, errInvalidStruct(s)
return nil, fmt.Errorf("invalid struct %v", s)
}
result := make(map[string]any)

View File

@@ -1,7 +0,0 @@
package structs
import "fmt"
func errInvalidStruct(v any) error {
return fmt.Errorf("invalid struct %v", v)
}