feat: update staff data

This commit is contained in:
ericprd
2025-03-14 12:41:11 +08:00
parent 1297c71200
commit 11bc19360c
31 changed files with 130 additions and 115 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
package utils
import (
"errors"
"fmt"
"reflect"
)
@@ -11,14 +11,14 @@ func StructToMap(s any) (map[string]any, error) {
val := reflect.ValueOf(s)
if val.Kind() != reflect.Struct {
return nil, errors.New("provided value is not struct")
return nil, fmt.Errorf("provided value is not struct")
}
for i := range val.NumField() {
field := val.Type().Field(i)
value := val.Field(i)
if value.IsZero() || value.IsNil() {
if !value.IsValid() {
continue
}