FileWithLineNum return the file name and line number of the current file
()
| 60 | |
| 61 | // FileWithLineNum return the file name and line number of the current file |
| 62 | func FileWithLineNum() string { |
| 63 | // Keep FileWithLineNum one frame outer than CallerFrame to preserve pre-v1.31.1 semantics. |
| 64 | frame := callerFrame(4) |
| 65 | if frame.PC != 0 { |
| 66 | return string(strconv.AppendInt(append([]byte(frame.File), ':'), int64(frame.Line), 10)) |
| 67 | } |
| 68 | |
| 69 | return "" |
| 70 | } |
| 71 | |
| 72 | func IsInvalidDBNameChar(c rune) bool { |
| 73 | return !unicode.IsLetter(c) && !unicode.IsNumber(c) && c != '.' && c != '*' && c != '_' && c != '$' && c != '@' |