mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-18 22:49:52 +02:00
fixed typos and formatting, fixed loading page not being shown (idlewaker)
This commit is contained in:
@@ -149,9 +149,8 @@ func Deserialize(src SerializedObject, dst any) E.NestedError {
|
||||
|
||||
if dstV.Kind() == reflect.Struct {
|
||||
mapping := make(map[string]reflect.Value)
|
||||
for i := 0; i < dstV.NumField(); i++ {
|
||||
field := dstT.Field(i)
|
||||
mapping[ToLowerNoSnake(field.Name)] = dstV.Field(i)
|
||||
for _, field := range reflect.VisibleFields(dstT) {
|
||||
mapping[ToLowerNoSnake(field.Name)] = dstV.FieldByName(field.Name)
|
||||
}
|
||||
for k, v := range src {
|
||||
if field, ok := mapping[ToLowerNoSnake(k)]; ok {
|
||||
@@ -322,7 +321,7 @@ func ConvertString(src string, dst reflect.Value) (convertible bool, convErr E.N
|
||||
var tmp any
|
||||
switch dst.Kind() {
|
||||
case reflect.Slice:
|
||||
// one liner is comma seperated list
|
||||
// one liner is comma separated list
|
||||
if len(lines) == 0 {
|
||||
dst.Set(reflect.ValueOf(CommaSeperatedList(src)))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user