- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 32 for ValueOf (0.16 sec)
-
callbacks/helper_test.go
vm = make(visitMap) if loaded = loadOrStoreVisitMap(&vm, reflect.ValueOf(&t1)); loaded { t.Fatalf("loaded should be false") } if loaded = loadOrStoreVisitMap(&vm, reflect.ValueOf(&t1)); !loaded { t.Fatalf("loaded should be true") } // t1 already exist but t2 not if loaded = loadOrStoreVisitMap(&vm, reflect.ValueOf([]*testM{&t1, &t2, &t3})); loaded { t.Fatalf("loaded should be false") }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 05 02:22:57 GMT 2024 - 3.4K bytes - Viewed (0) -
scan.go
} } } func scanIntoMap(mapValue map[string]interface{}, values []interface{}, columns []string) { for idx, column := range columns { if reflectValue := reflect.Indirect(reflect.Indirect(reflect.ValueOf(values[idx]))); reflectValue.IsValid() { mapValue[column] = reflectValue.Interface() if valuer, ok := mapValue[column].(driver.Valuer); ok { mapValue[column], _ = valuer.Value()
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Apr 26 09:53:11 GMT 2024 - 9.8K bytes - Viewed (0) -
utils/tests/utils.go
if reflect.ValueOf(got).Len() == reflect.ValueOf(expect).Len() { for i := 0; i < reflect.ValueOf(got).Len(); i++ { name := fmt.Sprintf(reflect.ValueOf(got).Type().Name()+" #%v", i) t.Run(name, func(t *testing.T) { AssertEqual(t, reflect.ValueOf(got).Index(i).Interface(), reflect.ValueOf(expect).Index(i).Interface()) }) } } else { name := reflect.ValueOf(got).Type().Elem().Name()
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Mar 10 09:21:56 GMT 2023 - 3.9K bytes - Viewed (0) -
callbacks/associations.go
if _, zero := rel.Field.ValueOf(db.Statement.Context, obj); !zero { rv := rel.Field.ReflectValueOf(db.Statement.Context, obj) if rv.Kind() != reflect.Ptr { rv = rv.Addr() } for _, ref := range rel.References { if ref.OwnPrimaryKey { fv, _ := ref.PrimaryKey.ValueOf(db.Statement.Context, obj)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Apr 11 03:06:13 GMT 2023 - 14.3K bytes - Viewed (0) -
schema/serializer.go
return } // Value implements serializer interface func (UnixSecondSerializer) Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (result interface{}, err error) { rv := reflect.ValueOf(fieldValue) switch v := fieldValue.(type) { case int64, int, uint, uint64, int32, uint32, int16, uint16: result = time.Unix(reflect.Indirect(rv).Int(), 0).UTC()
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Mar 18 08:28:46 GMT 2024 - 4.6K bytes - Viewed (0) -
callbacks/create.go
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 08 03:29:55 GMT 2024 - 12.5K bytes - Viewed (0) -
clause/expression.go
if afterParenthesis || expr.WithoutParentheses { if _, ok := expr.Vars[idx].(driver.Valuer); ok { builder.AddVar(builder, expr.Vars[idx]) } else { switch rv := reflect.ValueOf(expr.Vars[idx]); rv.Kind() { case reflect.Slice, reflect.Array: if rv.Len() == 0 { builder.AddVar(builder, nil) } else { for i := 0; i < rv.Len(); i++ { if i > 0 {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Oct 10 06:45:48 GMT 2023 - 8.3K bytes - Viewed (0) -
utils/utils.go
} return false } func AssertEqual(x, y interface{}) bool { if reflect.DeepEqual(x, y) { return true } if x == nil || y == nil { return false } xval := reflect.ValueOf(x) yval := reflect.ValueOf(y) if xval.Kind() == reflect.Ptr && xval.IsNil() || yval.Kind() == reflect.Ptr && yval.IsNil() { return false } if valuer, ok := x.(driver.Valuer); ok { x, _ = valuer.Value() }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 22 06:43:02 GMT 2024 - 3.8K bytes - Viewed (0) -
logger/sql.go
} case driver.Valuer: reflectValue := reflect.ValueOf(v) if v != nil && reflectValue.IsValid() && ((reflectValue.Kind() == reflect.Ptr && !reflectValue.IsNil()) || reflectValue.Kind() != reflect.Ptr) { r, _ := v.Value() convertParams(r, idx) } else { vars[idx] = nullStr } case fmt.Stringer: reflectValue := reflect.ValueOf(v) switch reflectValue.Kind() {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Mar 21 08:00:02 GMT 2024 - 5K bytes - Viewed (0) -
finisher_api.go
} } // Optimize for-break resultsValue := reflect.Indirect(reflect.ValueOf(dest)) if result.Statement.Schema.PrioritizedPrimaryField == nil { tx.AddError(ErrPrimaryKeyRequired) break } primaryValue, zero := result.Statement.Schema.PrioritizedPrimaryField.ValueOf(tx.Statement.Context, resultsValue.Index(resultsValue.Len()-1)) if zero { tx.AddError(ErrPrimaryKeyRequired)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 22.7K bytes - Viewed (0)