type HasName interface { Name() string } func Greet(n HasName) { fmt.Printf("Hello %s!\n", n.Name()) } type Joe struct {} func (_ *Joe) Name() string { return "Joe" } type Mike struct {} func (_ *Mike) Name() string { return "Mike" } func main() { joe := &Joe{} mike := &Mike{} Greet(mike) Greet(joe) }
It’s like some sort of weird pseudo object oriented code.
The * and := are completely foreign. The string interpolation is weird.
Not sure what or why the &.
At the end of the day, if you went to college and learned programming, CS with Java or C, maybe this make sense.
I learned CS with Scheme, and OCaml… so your mileage may vary.