jedib0t / go-pretty

Table-writer and more in golang!
MIT License
3.06k stars 120 forks source link

Calling SetRowPainter() will not compile #297

Closed jlanzarotta closed 9 months ago

jlanzarotta commented 9 months ago

Hello,

I am not sure if this is bug or not... but for some reason calling SetRowPainter() does not compile. I am using go 1.22.0 and go-pretty v6.5.4.

I am able to render a table just fine. It was when I add the call to t.SetRowPainter(), that does not compile. Here is a screenshot...

image

This code snippet does was taken from another example I found that was supposed to be working.

Any ideas?

Thanks,

jedib0t commented 9 months ago

Can you try following the example here: https://github.com/jedib0t/go-pretty/blob/main/table/render_test.go#L872-L881 ?

My IDE with golang 1.21.3 doesn't show any issues: image

I'll try 1.22.0 shortly.

jedib0t commented 9 months ago

It works with go 1.22.1 too: https://play.golang.com/p/65kYWlAx4nm --- it may be an IDE issue at your end?

image

jlanzarotta commented 9 months ago

Hello, thanks for the response. It ended up being that I had an incorrect import. Instead of having "github.com/jedib0t/go-pretty/v6/text", I had "github.com/jedib0t/go-pretty/text".