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:
Jin Hai
2026-06-10 20:38:43 +08:00
committed by GitHub
parent e132173d1a
commit 3e4fb8cf1c
8 changed files with 17 additions and 360 deletions

View File

@@ -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()