Skip to content

Commit

Permalink
adding UnimplementedGreeterServer to server struct (#1973)
Browse files Browse the repository at this point in the history
The compiler produces an error without this. The error is:

```
cannot use &server literal (type *server) as type helloworld.GreeterServer in argument to helloworld.RegisterGreeterServer:
	*server does not implement helloworld.GreeterServer (missing helloworld.mustEmbedUnimplementedGreeterServer method)
```
  • Loading branch information
nwandabridges authored Feb 16, 2021
1 parent 40d8c9e commit bce65a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/docs/tutorials/adding_annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ import (
helloworldpb "github.com/myuser/myrepo/proto/helloworld"
)

type server struct{}
type server struct{
helloworldpb.UnimplementedGreeterServer
}

func NewServer() *server {
return &server{}
Expand Down

0 comments on commit bce65a9

Please sign in to comment.