Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for CanAddr (0.14 sec)

  1. 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)
  2. scan.go

    	for idx, field := range fields {
    		if field != nil {
    			values[idx] = field.NewValuePool.Get()
    		} else if len(fields) == 1 {
    			if reflectValue.CanAddr() {
    				values[idx] = reflectValue.Addr().Interface()
    			} else {
    				values[idx] = reflectValue.Interface()
    			}
    		}
    	}
    
    	db.RowsAffected++
    	db.AddError(rows.Scan(values...))
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:57:36 UTC 2024
    - 10K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. src/internal/reflectlite/value.go

    	//	- flagStickyRO: obtained via unexported not embedded field, so read-only
    	//	- flagEmbedRO: obtained via unexported embedded field, so read-only
    	//	- flagIndir: val holds a pointer to the data
    	//	- flagAddr: v.CanAddr is true (implies flagIndir)
    	// Value cannot represent method values.
    	// The next five bits give the Kind of the value.
    	// This repeats typ.Kind() except for method values.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  7. 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)
  8. src/encoding/gob/encode.go

    			rt = rt.Elem()
    		}
    	}
    	var op encOp
    	op = func(i *encInstr, state *encoderState, v reflect.Value) {
    		if ut.encIndir == -1 {
    			// Need to climb up one level to turn value into pointer.
    			if !v.CanAddr() {
    				errorf("unaddressable value of type %s", rt)
    			}
    			v = v.Addr()
    		}
    		if !state.sendZero && v.IsZero() {
    			return
    		}
    		state.update(i)
    		state.enc.encodeGobEncoder(state.b, ut, v)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 02:00:26 UTC 2024
    - 19K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/storage/etcd3/store_test.go

    			}
    			// reflection requires that the value be addressable in order to call set,
    			// so we must ensure the value we created is available on the heap (not a problem
    			// for normal usage)
    			if !tt.args.v.CanAddr() {
    				x := reflect.New(tt.args.v.Type())
    				x.Elem().Set(tt.args.v)
    				tt.args.v = x.Elem()
    			}
    			growSlice(tt.args.v, tt.args.maxCapacity, tt.args.sizes...)
    			if tt.cap != tt.args.v.Cap() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 11 12:45:33 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  10. src/fmt/print.go

    		case 's', 'q', 'x', 'X':
    			// Handle byte and uint8 slices and arrays special for the above verbs.
    			t := f.Type()
    			if t.Elem().Kind() == reflect.Uint8 {
    				var bytes []byte
    				if f.Kind() == reflect.Slice || f.CanAddr() {
    					bytes = f.Bytes()
    				} else {
    					// We have an array, but we cannot Bytes() a non-addressable array,
    					// so we build a slice by hand. This is a rare case but it would be nice
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:22:43 UTC 2024
    - 31.8K bytes
    - Viewed (0)
Back to top