Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 254 for reflect (0.36 sec)

  1. logger/sql.go

    var convertibleTypes = []reflect.Type{reflect.TypeOf(time.Time{}), reflect.TypeOf(false), reflect.TypeOf([]byte{})}
    
    // RegEx matches only numeric values
    var numericPlaceholderRe = regexp.MustCompile(`\$\d+\$`)
    
    func isNumeric(k reflect.Kind) bool {
    	switch k {
    	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
    		return true
    	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
  2. callbacks/associations.go

    				isPtr := fieldType.Kind() == reflect.Ptr
    				if !isPtr {
    					fieldType = reflect.PtrTo(fieldType)
    				}
    				elems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    				distinctElems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    				joins := reflect.MakeSlice(reflect.SliceOf(reflect.PtrTo(rel.JoinTable.ModelType)), 0, 10)
    				objs := []reflect.Value{}
    
    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)
  3. clause/expression.go

    		case map[string]interface{}:
    			for k, v := range value {
    				namedMap[k] = v
    			}
    		default:
    			var appendFieldsToMap func(reflect.Value)
    			appendFieldsToMap = func(reflectValue reflect.Value) {
    				reflectValue = reflect.Indirect(reflectValue)
    				switch reflectValue.Kind() {
    				case reflect.Struct:
    					modelType := reflectValue.Type()
    					for i := 0; i < modelType.NumField(); i++ {
    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)
  4. 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 {
    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)
  5. scan.go

    					}
    				}
    			}
    		}
    
    		switch reflectValue.Kind() {
    		case reflect.Slice, reflect.Array:
    			var (
    				elem        reflect.Value
    				isArrayKind = reflectValue.Kind() == reflect.Array
    			)
    
    			if !update || reflectValue.Len() == 0 {
    				update = false
    				if isArrayKind {
    					db.Statement.ReflectValue.Set(reflect.Zero(reflectValue.Type()))
    				} else {
    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)
  6. utils/tests/utils.go

    				}
    				return
    			}
    		}
    
    		if reflect.ValueOf(got).Kind() == reflect.Struct {
    			if reflect.ValueOf(expect).Kind() == reflect.Struct {
    				if reflect.ValueOf(got).NumField() == reflect.ValueOf(expect).NumField() {
    					exported := false
    					for i := 0; i < reflect.ValueOf(got).NumField(); i++ {
    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)
  7. schema/serializer.go

    	switch v := fieldValue.(type) {
    	case int64, int, uint, uint64, int32, uint32, int16, uint16:
    		result = time.Unix(reflect.Indirect(rv).Int(), 0).UTC()
    	case *int64, *int, *uint, *uint64, *int32, *uint32, *int16, *uint16:
    		if rv.IsZero() {
    			return nil, nil
    		}
    		result = time.Unix(reflect.Indirect(rv).Int(), 0).UTC()
    	default:
    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)
  8. internal/event/rulesmap_test.go

    	}
    
    	for i, testCase := range testCases {
    		result := testCase.rulesMap.Clone()
    
    		if !reflect.DeepEqual(result, testCase.rulesMap) {
    			t.Fatalf("test %v: result: expected: %v, got: %v", i+1, testCase.rulesMap, result)
    		}
    
    		result.Add(testCase.rulesMapToAdd)
    		if reflect.DeepEqual(result, testCase.rulesMap) {
    			t.Fatalf("test %v: result: expected: not equal, got: equal", i+1)
    		}
    	}
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Jan 05 18:43:06 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  9. tests/callbacks_test.go

    			var v interface{} = callbacks.Create()
    			callMethod := func(s interface{}, name string, args ...interface{}) {
    				var argValues []reflect.Value
    				for _, arg := range args {
    					argValues = append(argValues, reflect.ValueOf(arg))
    				}
    
    				results := reflect.ValueOf(s).MethodByName(name).Call(argValues)
    				if len(results) > 0 {
    					v = results[0].Interface()
    				}
    			}
    
    			if c.name == "" {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  10. callbacks/visit_map_test.go

    		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")
    	}
    
    	if loaded = loadOrStoreVisitMap(&vm, reflect.ValueOf([]*testM{&t2, &t3})); !loaded {
    		t.Fatalf("loaded should be true")
    	}
    Go
    - Registered: Sun Feb 25 09:35:10 GMT 2024
    - Last Modified: Thu Mar 17 15:53:31 GMT 2022
    - 780 bytes
    - Viewed (0)
Back to top