I am trying to access values from an embedded slice in a struct. How can I do so via indexing, and without calling the private embedded object explicitly (which is not even an option when accessing from outside the package), if that's possible at all?
package main
import (
"fmt"
)
type A struct {
aSlice
}
type aSlice []string
func main() {
a := A{[]string{"hello", "world"}}
fmt.Println(a.aSlice[0]) // works, but can't be accessed outside package
fmt.Println(a[0]) // doesn't work, but looking for this something like this
}