I have a struct
of pointers in my app
type body struct {
A *string
B *string
}
I want to pass the values of A
and B
in the body
to function, such that if the pointer A
is null, pass a default empty string value. Something like:
sampleFunc(ctx,*A||"");
func sampleFunc(ctx Context,count string){
// ......
}
How do I do this?