the code
package main
import "fmt"
type unimplementedGreeterServer struct {
}
func (unimplementedGreeterServer) SayHello() string {
return "hello"
}
func main() {
s := &unimplementedGreeterServer{}
ret := s.SayHello()
fmt.Println(ret)
}
the result
hello
the question : why the SayHello method has no unimplementedGreeterServer point or unimplementedGreeterServer receiver can run
I think the right will be
func (s unimplementedGreeterServer) SayHello2() string {
return "hello"
}
func (s *unimplementedGreeterServer) SayHello3() string {
return "hello"
}
not
func (unimplementedGreeterServer) SayHello() string {
return "hello"
}