mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-19 22:21:04 +08:00
Go: fix test and remove unused code (#15909)
### What problem does this PR solve? 1. Fix go test, some cases still failed. 2. Remove unused code. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -422,24 +422,6 @@ func parseHostPort(hostPort string) (string, int, error) {
|
||||
return host, port, nil
|
||||
}
|
||||
|
||||
// looksLikeSQL checks if a string looks like a SQL command
|
||||
func looksLikeSQL(s string) bool {
|
||||
s = strings.ToUpper(strings.TrimSpace(s))
|
||||
sqlPrefixes := []string{
|
||||
"LIST ", "SHOW ", "CREATE ", "DROP ", "ALTER ",
|
||||
"LOGIN ", "REGISTER ", "PING", "GRANT ", "REVOKE ",
|
||||
"SET ", "UNSET ", "UPDATE ", "DELETE ", "INSERT ",
|
||||
"SELECT ", "DESCRIBE ", "EXPLAIN ", "ADD ", "ENABLE ", "DISABLE ", "CHAT ", "USE", "THINK",
|
||||
"REMOVE ",
|
||||
}
|
||||
for _, prefix := range sqlPrefixes {
|
||||
if strings.HasPrefix(s, prefix) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// PrintUsage prints the CLI usage information
|
||||
func PrintUsage() {
|
||||
fmt.Println(`RAGFlow CLI Client
|
||||
@@ -510,11 +492,6 @@ type CLI struct {
|
||||
Config *CommandLineConfig
|
||||
}
|
||||
|
||||
// NewCLI creates a new CLI instance
|
||||
//func NewCLI() (*CLI, error) {
|
||||
// return NewCLIWithArgs(nil)
|
||||
//}
|
||||
|
||||
func NewCLIWithConfig(commandLineConfig *CommandLineConfig) (*CLI, error) {
|
||||
// Create liner first
|
||||
line := liner.NewLiner()
|
||||
|
||||
Reference in New Issue
Block a user