isHashIDFormat 检查字符串是否符合hashID的一般格式(包含字母且不是纯数字)
(s string)
| 357 | |
| 358 | // isHashIDFormat 检查字符串是否符合hashID的一般格式(包含字母且不是纯数字) |
| 359 | func isHashIDFormat(s string) bool { |
| 360 | if len(s) < 3 { // hashID通常比较长 |
| 361 | return false |
| 362 | } |
| 363 | hasLetter := false |
| 364 | for _, char := range s { |
| 365 | if (char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z') { |
| 366 | hasLetter = true |
| 367 | break |
| 368 | } |
| 369 | } |
| 370 | return hasLetter |
| 371 | } |
no outgoing calls
no test coverage detected