what's the guideline on when to use pointer in API go struct? #3663
-
In the cronjob tutorials, in chapter of |
Beta Was this translation helpful? Give feedback.
Answered by
hujun-open
Oct 25, 2023
Replies: 1 comment
-
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. |
Beta Was this translation helpful? Give feedback.
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
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.