summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/schema/util.go
diff options
context:
space:
mode:
authorLibravatar kim (grufwub) <grufwub@gmail.com>2021-09-08 20:05:26 +0100
committerLibravatar kim (grufwub) <grufwub@gmail.com>2021-09-08 20:05:26 +0100
commitbdcc090851f37f1e81a53c1e695f897b1252cd22 (patch)
tree2d0926cdcf3088781842a83fd8ed50593006ccc2 /vendor/github.com/uptrace/bun/schema/util.go
parentrework media processing a little bit (#191) (diff)
downloadgotosocial-bdcc090851f37f1e81a53c1e695f897b1252cd22.tar.xz
update bun library -> v1.0.4
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/uptrace/bun/schema/util.go')
-rw-r--r--vendor/github.com/uptrace/bun/schema/util.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/vendor/github.com/uptrace/bun/schema/util.go b/vendor/github.com/uptrace/bun/schema/util.go
deleted file mode 100644
index 6d474e4cc..000000000
--- a/vendor/github.com/uptrace/bun/schema/util.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package schema
-
-import "reflect"
-
-func indirectType(t reflect.Type) reflect.Type {
- if t.Kind() == reflect.Ptr {
- t = t.Elem()
- }
- return t
-}
-
-func fieldByIndex(v reflect.Value, index []int) (_ reflect.Value, ok bool) {
- if len(index) == 1 {
- return v.Field(index[0]), true
- }
-
- for i, idx := range index {
- if i > 0 {
- if v.Kind() == reflect.Ptr {
- if v.IsNil() {
- return v, false
- }
- v = v.Elem()
- }
- }
- v = v.Field(idx)
- }
- return v, true
-}
-
-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
-}