1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Upgrade xorm to v1.1.1 (#16339)

This commit is contained in:
Lunny Xiao
2021-07-04 21:10:46 +08:00
committed by GitHub
parent 32fd11395b
commit 760af187ba
39 changed files with 989 additions and 1201 deletions

19
vendor/xorm.io/xorm/schemas/table.go generated vendored
View File

@@ -5,7 +5,6 @@
package schemas
import (
"fmt"
"reflect"
"strconv"
"strings"
@@ -159,24 +158,8 @@ func (table *Table) IDOfV(rv reflect.Value) (PK, error) {
for i, col := range table.PKColumns() {
var err error
fieldName := col.FieldName
for {
parts := strings.SplitN(fieldName, ".", 2)
if len(parts) == 1 {
break
}
pkField := v.FieldByIndex(col.FieldIndex)
v = v.FieldByName(parts[0])
if v.Kind() == reflect.Ptr {
v = v.Elem()
}
if v.Kind() != reflect.Struct {
return nil, fmt.Errorf("Unsupported read value of column %s from field %s", col.Name, col.FieldName)
}
fieldName = parts[1]
}
pkField := v.FieldByName(fieldName)
switch pkField.Kind() {
case reflect.String:
pk[i], err = col.ConvertID(pkField.String())