Search Options

Results per page
Sort
Preferred Languages
Advance

Results 121 - 130 of 250 for elem3 (0.04 sec)

  1. test/fixedbugs/bug461.go

    // part two of issue 4124. Make sure reflect doesn't mark the field as exported.
    
    package main
    
    import "reflect"
    
    var T struct {
    	int
    }
    
    func main() {
    	v := reflect.ValueOf(&T)
    	v = v.Elem().Field(0)
    	if v.CanSet() {
    		panic("int should be unexported")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 426 bytes
    - Viewed (0)
  2. src/encoding/xml/typeinfo.go

    	for i, x := range finfo.idx {
    		if i > 0 {
    			t := v.Type()
    			if t.Kind() == reflect.Pointer && t.Elem().Kind() == reflect.Struct {
    				if v.IsNil() {
    					if !shouldInitNilPointers {
    						return reflect.Value{}
    					}
    					v.Set(reflect.New(v.Type().Elem()))
    				}
    				v = v.Elem()
    			}
    		}
    		v = v.Field(x)
    	}
    	return v
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:23:29 UTC 2023
    - 9.6K bytes
    - Viewed (0)
  3. src/errors/wrap.go

    	}
    	val := reflectlite.ValueOf(target)
    	typ := val.Type()
    	if typ.Kind() != reflectlite.Ptr || val.IsNil() {
    		panic("errors: target must be a non-nil pointer")
    	}
    	targetType := typ.Elem()
    	if targetType.Kind() != reflectlite.Interface && !targetType.Implements(errorType) {
    		panic("errors: *target must be interface or implement error")
    	}
    	return as(err, target, val, targetType)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 17:13:04 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  4. test/fixedbugs/issue43112.go

    package p
    
    type Symbol interface{}
    
    type Value interface {
    	String() string
    }
    
    type Object interface {
    	String() string
    }
    
    type Scope struct {
    	outer *Scope
    	elems map[string]Object
    }
    
    func (s *Scope) findouter(name string) (*Scope, Object) {
    	return s.outer.findouter(name)
    }
    
    func (s *Scope) Resolve(name string) (sym Symbol) {
    	if _, obj := s.findouter(name); obj != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 14 03:21:35 UTC 2020
    - 723 bytes
    - Viewed (0)
  5. operator/pkg/tpath/struct.go

    func Set(val, out any) error {
    	// Special case: map out type must be set through map ptr.
    	if util.IsMap(val) && util.IsMapPtr(out) {
    		reflect.ValueOf(out).Elem().Set(reflect.ValueOf(val))
    		return nil
    	}
    	if util.IsSlice(val) && util.IsSlicePtr(out) {
    		reflect.ValueOf(out).Elem().Set(reflect.ValueOf(val))
    		return nil
    	}
    
    	if reflect.TypeOf(val) != reflect.TypeOf(out) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  6. pkg/api/testing/meta_test.go

    					}
    				default:
    					if _, ok := obj.(metav1.ListMetaAccessor); ok {
    						continue
    					}
    					if _, ok := value.Elem().Type().FieldByName("ObjectMeta"); ok {
    						t.Errorf("%v (%v) has ObjectMeta but does not implement ObjectMetaAccessor", gv.WithKind(kind), knownType)
    						continue
    					}
    					if _, ok := value.Elem().Type().FieldByName("ListMeta"); ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 14 10:11:56 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  7. test/typeparam/metrics.go

    // elements equal. All floating point NaNs are considered equal.
    func _SlicesEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    			if !isNaN(v1) || !isNaN(v2) {
    				return false
    			}
    		}
    	}
    	return true
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  8. src/path/path.go

    // empty or all its elements are empty, Join returns
    // an empty string.
    func Join(elem ...string) string {
    	size := 0
    	for _, e := range elem {
    		size += len(e)
    	}
    	if size == 0 {
    		return ""
    	}
    	buf := make([]byte, 0, size+len(elem)-1)
    	for _, e := range elem {
    		if len(buf) > 0 || e != "" {
    			if len(buf) > 0 {
    				buf = append(buf, '/')
    			}
    			buf = append(buf, e...)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 23 17:33:57 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  9. pkg/printers/tablegenerator.go

    			"Must accept 2 parameters and return 2 value")
    	}
    	if funcType.In(1) != reflect.TypeOf((*GenerateOptions)(nil)).Elem() ||
    		funcType.Out(0) != reflect.TypeOf((*[]metav1.TableRow)(nil)).Elem() ||
    		funcType.Out(1) != reflect.TypeOf((*error)(nil)).Elem() {
    		return fmt.Errorf("invalid print handler. The expected signature is: "+
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 26 17:14:05 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  10. test/fixedbugs/bug510.dir/a.go

    // license that can be found in the LICENSE file.
    
    package a
    
    import "reflect"
    
    type A = map[int] bool
    
    func F() interface{} {
    	return reflect.New(reflect.TypeOf((*A)(nil))).Elem().Interface()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 07 17:29:52 UTC 2020
    - 304 bytes
    - Viewed (0)
Back to top