diff options
author | Joop Kiefte <ikojba@gmail.com> | 2023-09-28 02:10:03 +0100 |
---|---|---|
committer | Joop Kiefte <ikojba@gmail.com> | 2023-09-28 02:10:03 +0100 |
commit | f9e7812c4addfa6ed04bde24c5435b664b875828 (patch) | |
tree | 57160a1a2c57850cb2b6abf7a12db465bd535ab4 | |
parent | d7dd8067ff2a8c01812e3bef9c80101c57820e83 (diff) |
Correct formatting
-rw-r--r-- | main.go | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -68,6 +68,7 @@ Running debby with any other arguments will run it as a dolt command.` for _, t := range tables { fmt.Printf(" [ %s ]", t) } + fmt.Println() // Request table name fmt.Print("Enter your table name: ") fmt.Scanln(&table) @@ -146,11 +147,15 @@ func ReadTableNames() []string { return []string{} } lines := strings.Split(string(out), "\n") - lines = lines[1:] + tables := []string{} for i, line := range lines { - lines[i] = strings.TrimSpace(line) + line = strings.TrimSpace(line) + if i == 0 || line == "" { + continue + } + tables = append(tables, line) } - return lines + return tables } func RunSQL(query, table string) error { |