- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 27 for CanAddr (0.21 sec)
-
association.go
if association.Relationship.Field.FieldType.Kind() == reflect.Struct { assignBacks = append(assignBacks, assignBack{Source: source, Dest: rv.Index(0)}) } } case reflect.Struct: if !rv.CanAddr() { association.Error = ErrInvalidValue return } association.Error = association.Relationship.Field.Set(association.DB.Statement.Context, source, rv.Addr().Interface())
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 21.5K bytes - Viewed (0) -
statement.go
destValue := reflect.ValueOf(stmt.Dest) for destValue.Kind() == reflect.Ptr { destValue = destValue.Elem() } if stmt.ReflectValue != destValue { if !destValue.CanAddr() { destValueCanAddr := reflect.New(destValue.Type()) destValueCanAddr.Elem().Set(destValue) stmt.Dest = destValueCanAddr.Interface() destValue = destValueCanAddr.Elem() }
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Fri Jan 12 08:42:21 UTC 2024 - 19.8K bytes - Viewed (0) -
callbacks.go
} } // assign stmt.ReflectValue if stmt.Dest != nil { stmt.ReflectValue = reflect.ValueOf(stmt.Dest) for stmt.ReflectValue.Kind() == reflect.Ptr { if stmt.ReflectValue.IsNil() && stmt.ReflectValue.CanAddr() { stmt.ReflectValue.Set(reflect.New(stmt.ReflectValue.Type().Elem())) } stmt.ReflectValue = stmt.ReflectValue.Elem() } if !stmt.ReflectValue.IsValid() { db.AddError(ErrInvalidValue) }
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Tue Mar 26 03:33:36 UTC 2024 - 8.6K bytes - Viewed (0) -
scan.go
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Wed Jun 12 10:57:36 UTC 2024 - 10K bytes - Viewed (0) -
src/cmd/compile/internal/test/inl_test.go
"FullRuneInString", "RuneLen", "AppendRune", "ValidRune", }, "unicode/utf16": { "Decode", }, "reflect": { "Value.Bool", "Value.Bytes", "Value.CanAddr", "Value.CanComplex", "Value.CanFloat", "Value.CanInt", "Value.CanInterface", "Value.CanSet", "Value.CanUint", "Value.Cap", "Value.Complex", "Value.Float",
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 09 04:07:57 UTC 2024 - 10.7K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/api/meta/help.go
} len := items.Len() if len == 0 { return nil } takeAddr := false if elemType := items.Type().Elem(); elemType.Kind() != reflect.Pointer && elemType.Kind() != reflect.Interface { if !items.Index(0).CanAddr() { return fmt.Errorf("unable to take address of items in %T for EachListItem", obj) } takeAddr = true } for i := 0; i < len; i++ { raw := items.Index(i) if takeAddr { if allocNew {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon May 29 16:25:43 UTC 2023 - 9.8K bytes - Viewed (0) -
src/text/template/exec.go
} // Unless it's an interface, need to get to a value of type *T to guarantee // we see all methods of T and *T. ptr := receiver if ptr.Kind() != reflect.Interface && ptr.Kind() != reflect.Pointer && ptr.CanAddr() { ptr = ptr.Addr() } if method := ptr.MethodByName(fieldName); method.IsValid() { return s.evalCall(dot, method, false, node, fieldName, args, final) } hasArgs := len(args) > 1 || !isMissing(final)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 21:22:24 UTC 2024 - 32K bytes - Viewed (0) -
src/encoding/json/encode.go
canAddrEnc, elseEnc encoderFunc } func (ce condAddrEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) { if v.CanAddr() { ce.canAddrEnc(e, v, opts) } else { ce.elseEnc(e, v, opts) } } // newCondAddrEncoder returns an encoder that checks whether its value // CanAddr and delegates to canAddrEnc if so, else to elseEnc. func newCondAddrEncoder(canAddrEnc, elseEnc encoderFunc) encoderFunc {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 00:18:55 UTC 2024 - 36.2K bytes - Viewed (0) -
src/reflect/value.go
return *(*[]rune)(v.ptr) } // CanAddr reports whether the value's address can be obtained with [Value.Addr]. // Such values are called addressable. A value is addressable if it is // an element of a slice, an element of an addressable array, // a field of an addressable struct, or the result of dereferencing a pointer. // If CanAddr returns false, calling [Value.Addr] will panic. func (v Value) CanAddr() bool { return v.flag&flagAddr != 0
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 21:17:41 UTC 2024 - 119.9K bytes - Viewed (0) -
test/escape_reflect.go
func ifacedata(x any) [2]uintptr { // ERROR "moved to heap: x" v := reflect.ValueOf(&x).Elem() return v.InterfaceData() } func can(x int) bool { v := reflect.ValueOf(x) // ERROR "x does not escape" return v.CanAddr() || v.CanInt() || v.CanSet() || v.CanInterface() } func is(x int) bool { v := reflect.ValueOf(x) // ERROR "x does not escape" return v.IsValid() || v.IsNil() || v.IsZero() } func is2(x [2]int) bool {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 08 18:50:24 UTC 2023 - 13.1K bytes - Viewed (0)