Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for CheckTruth (0.22 sec)

  1. utils/utils.go

    		}
    	}
    
    	return ""
    }
    
    func IsValidDBNameChar(c rune) bool {
    	return !unicode.IsLetter(c) && !unicode.IsNumber(c) && c != '.' && c != '*' && c != '_' && c != '$' && c != '@'
    }
    
    // CheckTruth check string true or not
    func CheckTruth(vals ...string) bool {
    	for _, val := range vals {
    		if val != "" && !strings.EqualFold(val, "false") {
    			return true
    		}
    	}
    	return false
    }
    
    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)
  2. schema/field.go

    		PrimaryKey:             utils.CheckTruth(tagSetting["PRIMARYKEY"], tagSetting["PRIMARY_KEY"]),
    		AutoIncrement:          utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
    		HasDefaultValue:        utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
    		NotNull:                utils.CheckTruth(tagSetting["NOT NULL"], tagSetting["NOTNULL"]),
    		Unique:                 utils.CheckTruth(tagSetting["UNIQUE"]),
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  3. utils/utils_test.go

    		{"false", false},
    		{"False", false},
    		{"FALSE", false},
    		{"\u0046alse", false},
    	}
    
    	for _, test := range checkTruthTests {
    		t.Run(test.v, func(t *testing.T) {
    			if out := CheckTruth(test.v); out != test.out {
    				t.Errorf("CheckTruth(%s) want: %t, got: %t", test.v, test.out, out)
    			}
    		})
    	}
    }
    
    func TestToStringKey(t *testing.T) {
    	cases := []struct {
    		values []interface{}
    		key    string
    	}{
    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)
Back to top