Skip to content

Commit

Permalink
removed unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeruS committed Aug 19, 2024
1 parent b44c863 commit 524d711
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions mssql/validate/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@ import (
"regexp"
)

// func SQLIdentifier(i interface{}, k string) (warnings []string, errors []error) {
// v := i.(string)
// if match, _ := regexp.Match("^[a-zA-Z_@#][a-zA-Z\\.\\d@$#_-]*$", []byte(v)); !match {
// errors = append(errors, fmt.Errorf(
// "invalid SQL identifier. SQL identifier allows letters, digits, @, $, #, . or _, start with letter, _, @ or # .Got %q", v))
// }

// if 1 > len(v) {
// errors = append(errors, fmt.Errorf("%q cannot be less than 1 character: %q", k, v))
// }

// if len(v) > 128 {
// errors = append(errors, fmt.Errorf("%q cannot be longer than 128 characters: %q %d", k, v, len(v)))
// }

// return
// }

func SQLIdentifier(i interface{}, k string) (warnings []string, errors []error) {
v := i.(string)
if (!regexp.MustCompile(`^[a-zA-Z0-9_.@#-]+$`).MatchString(v)) && (!regexp.MustCompile("SHARED ACCESS SIGNATURE").MatchString(v)) {
Expand Down

0 comments on commit 524d711

Please sign in to comment.