From f9e7812c4addfa6ed04bde24c5435b664b875828 Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Thu, 28 Sep 2023 02:10:03 +0100 Subject: Correct formatting --- main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 00fc0d1..2bf000e 100644 --- a/main.go +++ b/main.go @@ -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 { -- cgit v1.2.3-70-g09d2