Skip to content

what's the guideline on when to use pointer in API go struct? #3663

Closed Answered by hujun-open
hujun-open asked this question in Support
Discussion options

You must be logged in to vote

ok, after some research, one guideline I found is if you need to know whether a given field has user input value, then you should use a pointer, nil means no user input. so that you could initialize it with some default value.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hujun-open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
1 participant