refactor: remove struct_internal.go

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

No files matched your search

+2 -1
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)
-7
View File
@@ -1,7 +0,0 @@
package structs
import "fmt"
func errInvalidStruct(v any) error {
return fmt.Errorf("invalid struct %v", v)
}