I'm working on a Go project using the gocui library for creating a terminal-based user interface. I have a list of results that I want to display in a tabular format with multiple columns. However, I'm having trouble achieving the desired layout.
I have earlier used termbox-go library and achieved the output using this code:
func renderText(row, column int, text string) {
for i, char := range text {
termbox.SetCell(column+i, row, char, termbox.ColorDefault, termbox.ColorDefault)
}
}
I have tried doing this with gocui but it didn't work:
func renderText(v *gocui.View, row, column int, text string) {
v.Write([]byte(fmt.Sprintf("\033[%d;%dH%s", row+1, column, text)))
}
I am new to golang so any help would be appreciated.