Closed keithknott26 closed 5 years ago
So the issue is with this line:
grid := ui.NewGrid()
which should be changed to
grid = ui.NewGrid()
with the colon removed.
Instead of assigning to the global grid variable, you're creating a new local grid, so the global grid stays nil
. Definitely one of the gotchas with Go. :)
Let me know if you have any other questions.
Hello,
This should probably be tagged as a question instead of as a bug, I'm trying to follow your examples from goTop and using the following code snippet (some bits are stripped out) I'm getting the following error when rendering the grid.
[5/5]0xc0000ac3c0[5/5]0xc0000ac370panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1115845]
goroutine 1 [running]: github.com/gizak/termui.(*Grid).GetRect(0x0, 0x0, 0x6, 0xffffffffffffffff, 0x0)