updated dependencies and go
This commit is contained in:
@@ -2,7 +2,6 @@ package reflectext
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -29,7 +28,7 @@ type AccessStructOpt struct {
|
||||
}
|
||||
|
||||
func AccessJSONStruct[TResult any](v any, path string) (TResult, error) {
|
||||
return AccessStructByStringPath[TResult](v, path, AccessStructOpt{UsedTagForKeys: langext.Ptr("json")})
|
||||
return AccessStructByStringPath[TResult](v, path, AccessStructOpt{UsedTagForKeys: new("json")})
|
||||
}
|
||||
|
||||
func AccessStruct[TResult any](v any, path string) (TResult, error) {
|
||||
@@ -84,7 +83,7 @@ func accessStructByPath(val reflect.Value, path []string, opt AccessStructOpt) (
|
||||
|
||||
currPath := path[0]
|
||||
|
||||
if val.Kind() == reflect.Ptr {
|
||||
if val.Kind() == reflect.Pointer {
|
||||
if val.IsNil() {
|
||||
if opt.ReturnNilOnNilPtrFields {
|
||||
return nil, nil
|
||||
|
||||
Reference in New Issue
Block a user