Is there a short hand for accessing x.Bar[0] in the following case?
The direct attempt results in (type *[]string does not support indexing) for obvious reasons
type A struct {
B *[]string
}
x := &Foo{Bar: &[]string{"1", "2"}}
It would be
(*x.Bar)[0]
You use parentheses to change the precedence of operators: [] has a higher precedence than *.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With