mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-31 21:52:24 -05:00
upstep bun to v1.0.14 (#291)
This commit is contained in:
parent
84a8a07f38
commit
8b7c3507fe
100 changed files with 5071 additions and 3836 deletions
18
vendor/github.com/uptrace/bun/schema/scan.go
generated
vendored
18
vendor/github.com/uptrace/bun/schema/scan.go
generated
vendored
|
|
@ -8,6 +8,7 @@ import (
|
|||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/vmihailenco/msgpack/v5"
|
||||
|
|
@ -52,6 +53,8 @@ func init() {
|
|||
}
|
||||
}
|
||||
|
||||
var scannerMap sync.Map
|
||||
|
||||
func FieldScanner(dialect Dialect, field *Field) ScannerFunc {
|
||||
if field.Tag.HasOption("msgpack") {
|
||||
return scanMsgpack
|
||||
|
|
@ -65,10 +68,23 @@ func FieldScanner(dialect Dialect, field *Field) ScannerFunc {
|
|||
return scanJSONIntoInterface
|
||||
}
|
||||
}
|
||||
return dialect.Scanner(field.StructField.Type)
|
||||
return Scanner(field.StructField.Type)
|
||||
}
|
||||
|
||||
func Scanner(typ reflect.Type) ScannerFunc {
|
||||
if v, ok := scannerMap.Load(typ); ok {
|
||||
return v.(ScannerFunc)
|
||||
}
|
||||
|
||||
fn := scanner(typ)
|
||||
|
||||
if v, ok := scannerMap.LoadOrStore(typ, fn); ok {
|
||||
return v.(ScannerFunc)
|
||||
}
|
||||
return fn
|
||||
}
|
||||
|
||||
func scanner(typ reflect.Type) ScannerFunc {
|
||||
kind := typ.Kind()
|
||||
|
||||
if kind == reflect.Ptr {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue