implement fmt.Stringer for specialised arrays#1309
Open
Ferada wants to merge 1 commit intolib:masterfrom
Open
Conversation
Collaborator
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a bunch of methods to the specialised arrays that come out of
Arrayto support debugging.At the moment printing them with
%v" just results in a pointer (except for theGenericArray` 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.