Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for str (0.13 sec)

  1. schema/callbacks_test.go

    	if err != nil {
    		t.Fatalf("failed to parse user with callback, got error %v", err)
    	}
    
    	for _, str := range []string{"BeforeSave", "AfterCreate"} {
    		if !reflect.Indirect(reflect.ValueOf(user)).FieldByName(str).Interface().(bool) {
    			t.Errorf("%v should be true", str)
    		}
    	}
    
    	for _, str := range []string{"BeforeCreate", "BeforeUpdate", "AfterUpdate", "AfterSave", "BeforeDelete", "AfterDelete", "AfterFind"} {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 939 bytes
    - Viewed (0)
  2. schema/naming.go

    }
    
    // JoinTableName convert string to join table name
    func (ns NamingStrategy) JoinTableName(str string) string {
    	if !ns.NoLowerCase && strings.ToLower(str) == str {
    		return ns.TablePrefix + str
    	}
    
    	if ns.SingularTable {
    		return ns.TablePrefix + ns.toDBName(str)
    	}
    	return ns.TablePrefix + inflection.Plural(ns.toDBName(str))
    }
    
    // RelationshipFKName generate fk name for relation
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  3. internal/config/bool-flag.go

    // Any other value returns an error.
    func ParseBool(str string) (bool, error) {
    	switch str {
    	case "1", "t", "T", "true", "TRUE", "True", "on", "ON", "On":
    		return true, nil
    	case "0", "f", "F", "false", "FALSE", "False", "off", "OFF", "Off":
    		return false, nil
    	}
    	if strings.EqualFold(str, "enabled") {
    		return true, nil
    	}
    	if strings.EqualFold(str, "disabled") {
    		return false, nil
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 07 15:10:40 GMT 2022
    - 2.3K bytes
    - Viewed (0)
  4. internal/config/compress/compress_test.go

    		{"text/*,application/json", []string{"text/*", "application/json"}, true},
    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run(testCase.str, func(t *testing.T) {
    			gotPatterns, err := parseCompressIncludes(testCase.str)
    			if !testCase.success && err == nil {
    				t.Error("expected failure but success instead")
    			}
    			if testCase.success && err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 1.8K bytes
    - Viewed (0)
  5. internal/amztime/parse.go

    }
    
    // ParseReplicationTS parse http.TimeFormat first
    // will try time.RFC3339Nano when parse http.TimeFormat failed
    func ParseReplicationTS(str string) (time.Time, error) {
    	tm, err := time.Parse(http.TimeFormat, str)
    	if tm.IsZero() || err != nil {
    		tm, err = time.Parse(time.RFC3339Nano, str)
    	}
    	return tm, err
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  6. internal/s3select/sql/jsonpath_test.go

    		{"s.authorInfo.yearRange[0]", []interface{}{1890.0, 1920.0, 1881.0}},
    		{"s.publicationHistory[0].pages", []interface{}{256.0, 336.0, Missing{}}},
    	}
    	for i, tc := range cases {
    		t.Run(tc.str, func(t *testing.T) {
    			jp := JSONPath{}
    			err := p.ParseString(tc.str, &jp)
    			// fmt.Println(jp)
    			if err != nil {
    				t.Fatalf("parse failed!: %d %v %s", i, err, tc)
    			}
    
    			// Read only the first json object from the file
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 2.8K bytes
    - Viewed (0)
  7. internal/config/bool-flag_test.go

    		expectedResult string
    	}{
    		{bf, "off"},
    		{BoolFlag(true), "on"},
    		{BoolFlag(false), "off"},
    	}
    
    	for _, testCase := range testCases {
    		str := testCase.flag.String()
    		if testCase.expectedResult != str {
    			t.Fatalf("expected: %v, got: %v", testCase.expectedResult, str)
    		}
    	}
    }
    
    // Test BoolFlag.MarshalJSON()
    func TestBoolFlagMarshalJSON(t *testing.T) {
    	var bf BoolFlag
    
    	testCases := []struct {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 3.5K bytes
    - Viewed (0)
  8. src/bytes/example_test.go

    	fmt.Printf("%s\n", bytes.ToTitle([]byte("хлеб")))
    	// Output:
    	// LOUD NOISES
    	// ХЛЕБ
    }
    
    func ExampleToTitleSpecial() {
    	str := []byte("ahoj vývojári golang")
    	totitle := bytes.ToTitleSpecial(unicode.AzeriCase, str)
    	fmt.Println("Original : " + string(str))
    	fmt.Println("ToTitle : " + string(totitle))
    	// Output:
    	// Original : ahoj vývojári golang
    	// ToTitle : AHOJ VÝVOJÁRİ GOLANG
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  9. schema/relationship.go

    	return
    }
    
    func (rel *Relationship) ParseConstraint() *Constraint {
    	str := rel.Field.TagSettings["CONSTRAINT"]
    	if str == "-" {
    		return nil
    	}
    
    	if rel.Type == BelongsTo {
    		for _, r := range rel.FieldSchema.Relationships.Relations {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  10. schema/utils.go

    	"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 {
    				if names[j][len(names[j])-1] == '\\' {
    					i++
    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)
Back to top