When we want to pass a string pointer to a struct member each time we have to create a separate variable and pass the address of that to the member variable, Which is a pain. This wrapper function will ease all those efforts.
Eg:
type Employee struct{
Name *string
}
To pass a variable in testing , we have to
testName := "hello"
emp := Employee{
Name: &testName,
}
I have added a pull request to address this as #63299
With this function it is
emp: = Employee{
Name: strings.StringPointerFrom("hello")
}
It is really helpful when we are using table tests.