diff --git a/_examples/golang-basics/main.go b/_examples/golang-basics/main.go index 4d79d34a..17454a1f 100644 --- a/_examples/golang-basics/main.go +++ b/_examples/golang-basics/main.go @@ -2,6 +2,7 @@ package main import ( "context" + "fmt" "log" "net/http" @@ -55,6 +56,9 @@ func (s *ExampleServiceRPC) GetUser(ctx context.Context, header map[string]strin if userID == 911 { return 0, nil, ErrUserNotFound } + if userID == 31337 { + return 0, nil, ErrorWithCause(ErrUserNotFound, fmt.Errorf("unknown user id %d", userID)) + } return 200, &User{ ID: userID,