Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for elem (0.15 sec)

  1. schema/utils.go

    	case reflect.Slice, reflect.Array:
    		for i := 0; i < reflectValue.Len(); i++ {
    			elem := reflectValue.Index(i)
    			elemKey := elem.Interface()
    			if elem.Kind() != reflect.Ptr && elem.CanAddr() {
    				elemKey = elem.Addr().Interface()
    			}
    
    			if _, ok := loaded[elemKey]; ok {
    				continue
    			}
    			loaded[elemKey] = true
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  2. utils/utils.go

    			if vv.IsValid() && !vv.IsZero() {
    				results[idx] = fmt.Sprint(reflect.Indirect(vv).Interface())
    			}
    		}
    	}
    
    	return strings.Join(results, "_")
    }
    
    func Contains(elems []string, elem string) bool {
    	for _, e := range elems {
    		if elem == e {
    			return true
    		}
    	}
    	return false
    }
    
    func AssertEqual(x, y interface{}) bool {
    	if reflect.DeepEqual(x, y) {
    		return true
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  3. utils/tests/utils.go

    						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()
    					t.Errorf("%v expects length: %v, got %v (expects: %+v, got %+v)", name, reflect.ValueOf(expect).Len(), reflect.ValueOf(got).Len(), expect, got)
    				}
    				return
    			}
    		}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Mar 10 09:21:56 GMT 2023
    - 3.9K bytes
    - Viewed (0)
Back to top