- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 74 for utils (0.16 sec)
-
schema/utils.go
package schema import ( "context" "fmt" "reflect" "regexp" "strings" "gorm.io/gorm/clause" "gorm.io/gorm/utils" ) var embeddedCacheKey = "embedded_cache_store" func ParseTagSetting(str string, sep string) map[string]string { settings := map[string]string{} names := strings.Split(str, sep) for i := 0; i < len(names); i++ { j := i if len(names[j]) > 0 { for {
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) -
utils/tests/utils.go
"fmt" "go/ast" "reflect" "testing" "time" "gorm.io/gorm/utils" ) func AssertObjEqual(t *testing.T, r, e interface{}, names ...string) { for _, name := range names { rv := reflect.Indirect(reflect.ValueOf(r)) ev := reflect.Indirect(reflect.ValueOf(e)) if rv.IsValid() != ev.IsValid() { t.Errorf("%v: expect: %+v, got %+v", utils.FileWithLineNum(), r, e) 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) -
utils/utils.go
package utils import ( "database/sql/driver" "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)
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) -
utils/utils_test.go
package utils import ( "database/sql" "database/sql/driver" "errors" "math" "strings" "testing" "time" ) func TestIsValidDBNameChar(t *testing.T) { for _, db := range []string{"db", "dbName", "db_name", "db1", "1dbname", "db$name"} { if fields := strings.FieldsFunc(db, IsValidDBNameChar); len(fields) != 1 { t.Fatalf("failed to parse db name %v", db) } } } func TestCheckTruth(t *testing.T) {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Feb 19 03:42:25 GMT 2024 - 3.6K bytes - Viewed (0) -
schema/utils_test.go
Jinzhu <******@****.***> 1596190765 +0800
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Jul 31 10:19:25 GMT 2020 - 1.5K bytes - Viewed (0) -
utils/utils_unix_test.go
package utils import ( "testing" ) func TestSourceDir(t *testing.T) { cases := []struct { file string want string }{ { file: "/Users/name/go/pkg/mod/gorm.io/gorm@v1.2.3/utils/utils.go", want: "/Users/name/go/pkg/mod/gorm.io/", }, { file: "/go/work/proj/gorm/utils/utils.go", want: "/go/work/proj/gorm/", }, { file: "/go/work/proj/gorm_alias/utils/utils.go",
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Nov 21 02:48:13 GMT 2022 - 731 bytes - Viewed (0) -
utils/utils_windows_test.go
package utils import ( "testing" ) func TestSourceDir(t *testing.T) { cases := []struct { file string want string }{ { file: `C:/Users/name/go/pkg/mod/gorm.io/gorm@v1.2.3/utils/utils.go`, want: `C:/Users/name/go/pkg/mod/gorm.io/`, }, { file: `C:/go/work/proj/gorm/utils/utils.go`, want: `C:/go/work/proj/gorm/`, }, { file: `C:/go/work/proj/gorm_alias/utils/utils.go`,
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Nov 21 02:48:13 GMT 2022 - 715 bytes - Viewed (0) -
tests/update_many2many_test.go
package tests_test import ( "testing" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestUpdateMany2ManyAssociations(t *testing.T) { user := *GetUser("update-many2many", Config{}) if err := DB.Create(&user).Error; err != nil { t.Fatalf("errors happened when create: %v", err) } user.Languages = []Language{{Code: "zh-CN", Name: "Chinese"}, {Code: "en", Name: "English"}} for _, lang := range user.Languages {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 1.3K bytes - Viewed (0) -
tests/associations_has_one_test.go
package tests_test import ( "testing" . "gorm.io/gorm/utils/tests" ) func TestHasOneAssociation(t *testing.T) { user := *GetUser("hasone", Config{Account: true}) if err := DB.Create(&user).Error; err != nil { t.Fatalf("errors happened when create: %v", err) } CheckUser(t, user, user) // Find var user2 User DB.Find(&user2, "id = ?", user.ID) DB.Model(&user2).Association("Account").Find(&user2.Account)
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 6.8K bytes - Viewed (0) -
tests/update_test.go
package tests_test import ( "errors" "regexp" "sort" "strings" "testing" "time" "gorm.io/gorm" "gorm.io/gorm/clause" "gorm.io/gorm/utils" . "gorm.io/gorm/utils/tests" ) func TestUpdate(t *testing.T) { var ( users = []*User{ GetUser("update-1", Config{}), GetUser("update-2", Config{}), GetUser("update-3", Config{}), } user = users[1] lastUpdatedAt time.Time )
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Dec 04 03:50:58 GMT 2023 - 30.3K bytes - Viewed (0)