Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ToString (0.14 sec)

  1. utils/utils.go

    	}
    
    	if valuer, ok := x.(driver.Valuer); ok {
    		x, _ = valuer.Value()
    	}
    	if valuer, ok := y.(driver.Valuer); ok {
    		y, _ = valuer.Value()
    	}
    	return reflect.DeepEqual(x, y)
    }
    
    func ToString(value interface{}) string {
    	switch v := value.(type) {
    	case string:
    		return v
    	case int:
    		return strconv.FormatInt(int64(v), 10)
    	case int8:
    		return strconv.FormatInt(int64(v), 10)
    	case int16:
    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)
  2. logger/sql.go

    			} else {
    				vars[idx] = escaper + "<binary>" + escaper
    			}
    		case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
    			vars[idx] = utils.ToString(v)
    		case float32:
    			vars[idx] = strconv.FormatFloat(float64(v), 'f', -1, 32)
    		case float64:
    			vars[idx] = strconv.FormatFloat(v, 'f', -1, 64)
    		case string:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
  3. utils/utils_test.go

    		{"string", "abc", "abc"},
    		{"other", true, ""},
    	}
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			if out := ToString(test.in); test.out != out {
    				t.Fatalf("ToString(%v) want: %s, got: %s", test.in, test.out, out)
    			}
    		})
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  4. schema/field.go

    			case []byte:
    				field.ReflectValueOf(ctx, value).SetString(string(data))
    			case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
    				field.ReflectValueOf(ctx, value).SetString(utils.ToString(data))
    			case float64, float32:
    				field.ReflectValueOf(ctx, value).SetString(fmt.Sprintf("%."+strconv.Itoa(field.Precision)+"f", data))
    			default:
    				return fallbackSetter(ctx, value, v, field.Set)
    			}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
Back to top