I can't find anything about *interface{} on google. So... The question is why these two approaches work differently?
package main
type MyStruct struct {}
func valI(x interface{}) {}
func pointI(x *interface{}) {}
func valS(s MyStruct) {}
func pointS(s *MyStruct) {}
func main() {
s := MyStruct{}
p := &s
valI(s)
valI(p) // Why? Success
pointI(s) // Why? Fail: cannot use s (type S) as type *interface {} in argument to point: *interface {} is pointer to interface, not interface
pointI(p) // Why? Fail: cannot use p (type *S) as type *interface {} in argument to point: *interface {} is pointer to interface, not interface
valS(s)
valS(p) // It's obvious to me why these two fail
pointS(s) // -//-
pointS(p)
}
Playground: https://play.golang.org/p/pio5vf-fBxH