Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for IsInvalidDBNameChar (0.08 sec)

  1. utils/utils.go

    func FileWithLineNum() string {
    	frame := CallerFrame()
    	if frame.PC != 0 {
    		return string(strconv.AppendInt(append([]byte(frame.File), ':'), int64(frame.Line), 10))
    	}
    
    	return ""
    }
    
    func IsInvalidDBNameChar(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 {
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Oct 30 10:56:26 UTC 2025
    - 4.5K bytes
    - Viewed (0)
  2. utils/utils_test.go

    	"strings"
    	"testing"
    	"time"
    )
    
    func TestIsInvalidDBNameChar(t *testing.T) {
    	for _, db := range []string{"db", "dbName", "db_name", "db1", "1dbname", "db$name"} {
    		if fields := strings.FieldsFunc(db, IsInvalidDBNameChar); len(fields) != 1 {
    			t.Fatalf("failed to parse db name %v", db)
    		}
    	}
    }
    
    func TestCheckTruth(t *testing.T) {
    	checkTruthTests := []struct {
    		v   string
    		out bool
    	}{
    		{"123", true},
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Fri Sep 19 01:49:06 UTC 2025
    - 4.9K bytes
    - Viewed (0)
Back to top