- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for func (0.03 sec)
-
utils/utils.go
"fmt" "path/filepath" "reflect" "runtime" "strconv" "strings" "unicode" ) var gormSourceDir string func init() { _, file, _, _ := runtime.Caller(0) // compatible solution to get gorm source directory with various operating systems gormSourceDir = sourceDir(file) } func sourceDir(file string) string { dir := filepath.Dir(file) dir = filepath.Dir(dir) s := filepath.Dir(dir)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Aug 22 11:03:42 UTC 2024 - 4.1K bytes - Viewed (0) -
internal/dsync/utils.go
package dsync import ( "math/rand" "time" ) func backoffWait(min, unit, cap time.Duration) func(*rand.Rand, uint) time.Duration { if unit > time.Hour { // Protect against integer overflow panic("unit cannot exceed one hour") } return func(r *rand.Rand, attempt uint) time.Duration { sleep := min sleep += unit * time.Duration(attempt) if sleep > cap {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat May 13 15:42:21 UTC 2023 - 1.2K bytes - Viewed (0) -
schema/utils.go
} else if k != "" { settings[k] = k } } return settings } func toColumns(val string) (results []string) { if val != "" { for _, v := range strings.Split(val, ",") { results = append(results, strings.TrimSpace(v)) } } return } func removeSettingFromTag(tag reflect.StructTag, names ...string) reflect.StructTag { for _, name := range names {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sat Aug 19 13:35:14 UTC 2023 - 5.5K bytes - Viewed (0) -
utils/tests/utils.go
} got := rv.FieldByName(name).Interface() expect := ev.FieldByName(name).Interface() t.Run(name, func(t *testing.T) { AssertEqual(t, got, expect) }) } } func AssertEqual(t *testing.T, got, expect interface{}) { if !reflect.DeepEqual(got, expect) { isEqual := func() { if curTime, ok := got.(time.Time); ok { format := "2006-01-02T15:04:05Z07:00"
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Mar 10 09:21:56 UTC 2023 - 3.9K bytes - Viewed (0)