-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Depointerizer types #102
Depointerizer types #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add some test cases that exercise the depointerizing config options.
encoding/gocode/decorators.go
Outdated
return nil, false | ||
} | ||
|
||
func DecoderCompactor() dstutil.ApplyFunc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's unexport this, i don't think there's value in exposing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, thnx
I'll defer to a follow-up adding test cases to cover these, as we're quite short on time right now and it's not atypical of other things in thema (unfortunately 😭) that they're not tested |
It moves
DecoderCompactor
from Grafana and createDepointerizer
function to remove pointers from the types.By default, we are going to remove always the pointers in maps and slices but in the rest of the types will be optional. So the user could decide to remove these pointers or not setting
NoOptionalPointers
in the configuration.Related: grafana/grok#1