I wish to model a value which can have two possible forms: absent, or a string.
The natural way to do this is with Maybe String, or Optional
You could use something like sql.NullString, but I personally would stick to *string. As for awkwardness, it's true that you can't just sp := &"foo" unfortunately. But there is a workaround for this:
func strPtr(s string) *string {
return &s
}
Calls to strPtr("foo") should be inlined, so it's effectively &"foo".
Another possibility is to use new:
sp := new(string)
*sp = "foo"