Skip to content

implement fmt.Stringer for specialised arrays#1309

Open
Ferada wants to merge 1 commit intolib:masterfrom
Ferada:add-stringer-for-arrays
Open

implement fmt.Stringer for specialised arrays#1309
Ferada wants to merge 1 commit intolib:masterfrom
Ferada:add-stringer-for-arrays

Conversation

@Ferada
Copy link
Copy Markdown

@Ferada Ferada commented Apr 2, 2026

This adds a bunch of methods to the specialised arrays that come out of Array to support debugging.

At the moment printing them with %v" just results in a pointer (except for the GenericArray` actually), which is obviously not super useful when you just want to see the arguments that get passed to a query. There's probably any number of ways to do this, love to hear your feedback if there's a better way.

@arp242
Copy link
Copy Markdown
Collaborator

arp242 commented Apr 2, 2026

Not sure about this to be honest. It prints things identical to what fmt.Println() would print without a String() method, but hides some bits. This seems very confusing: it's not at all obvious there's a fmt.Stringer there and that it's printing something other from what you have. This seems the worst of everything: it neither prints things accurately, but it's also not significantly more helpful than "just dump the data".

Printing the Value() would probably be better, if we must change something here. Maybe with some extra spacing for readability.

I'd rather pick this up as part of #1103 rather than change soon-to-be-deprecated methods. I have a working branch for that already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants