mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 20:52:26 -05:00
[chore] bump bun v1.1.14 -> v1.1.15 (#2195)
This commit is contained in:
parent
23dd6f664c
commit
7011f57b09
27 changed files with 273 additions and 90 deletions
24
vendor/github.com/uptrace/bun/internal/util.go
generated
vendored
24
vendor/github.com/uptrace/bun/internal/util.go
generated
vendored
|
|
@ -55,3 +55,27 @@ func Unwrap(err error) error {
|
|||
}
|
||||
return u.Unwrap()
|
||||
}
|
||||
|
||||
func FieldByIndexAlloc(v reflect.Value, index []int) reflect.Value {
|
||||
if len(index) == 1 {
|
||||
return v.Field(index[0])
|
||||
}
|
||||
|
||||
for i, idx := range index {
|
||||
if i > 0 {
|
||||
v = indirectNil(v)
|
||||
}
|
||||
v = v.Field(idx)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func indirectNil(v reflect.Value) reflect.Value {
|
||||
if v.Kind() == reflect.Ptr {
|
||||
if v.IsNil() {
|
||||
v.Set(reflect.New(v.Type().Elem()))
|
||||
}
|
||||
v = v.Elem()
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue