I posted this question the other day and don't see it (may have posted from
another gmail account and it's still pending approval)... so here I am
again.
Let's say I have something like below:
type (
Person struct {
FirstName *string
}
)
Usually, I see something like the following when assigning:
fn := "John"
_ = Person{
FirstName: &fn,
}
Would something like the following be alright and acceptable practice:
_ = Person{
FirstName: pString("John")
}
func pString(content string) *string {
return &content
}
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/aa31103a-440b-4375-a1af-383f59c353f2%40googlegroups.com.