增加websocket支持

This commit is contained in:
2025-09-08 13:47:13 +08:00
parent 9caedd697d
commit 7e0fd53dd3
336 changed files with 9020 additions and 20356 deletions

21
vendor/gorm.io/gorm/utils/utils.go generated vendored
View File

@@ -32,16 +32,11 @@ func sourceDir(file string) string {
// FileWithLineNum return the file name and line number of the current file
func FileWithLineNum() string {
pcs := [13]uintptr{}
// the third caller usually from gorm internal
len := runtime.Callers(3, pcs[:])
frames := runtime.CallersFrames(pcs[:len])
for i := 0; i < len; i++ {
// second return value is "more", not "ok"
frame, _ := frames.Next()
if (!strings.HasPrefix(frame.File, gormSourceDir) ||
strings.HasSuffix(frame.File, "_test.go")) && !strings.HasSuffix(frame.File, ".gen.go") {
return string(strconv.AppendInt(append([]byte(frame.File), ':'), int64(frame.Line), 10))
// the second caller usually from gorm internal, so set i start from 2
for i := 2; i < 15; i++ {
_, file, line, ok := runtime.Caller(i)
if ok && (!strings.HasPrefix(file, gormSourceDir) || strings.HasSuffix(file, "_test.go")) {
return file + ":" + strconv.FormatInt(int64(line), 10)
}
}
@@ -78,11 +73,7 @@ func ToStringKey(values ...interface{}) string {
case uint:
results[idx] = strconv.FormatUint(uint64(v), 10)
default:
results[idx] = "nil"
vv := reflect.ValueOf(v)
if vv.IsValid() && !vv.IsZero() {
results[idx] = fmt.Sprint(reflect.Indirect(vv).Interface())
}
results[idx] = fmt.Sprint(reflect.Indirect(reflect.ValueOf(v)).Interface())
}
}