Skip to content

Instantly share code, notes, and snippets.

@sevein
Last active April 7, 2019 00:28
Show Gist options
  • Save sevein/ddbec1c4e00ea3c3e1c14c8efb5c335b to your computer and use it in GitHub Desktop.
Save sevein/ddbec1c4e00ea3c3e1c14c8efb5c335b to your computer and use it in GitHub Desktop.
diff --git a/server/server.go b/server/server.go
index 16d2068..930602d 100644
--- a/server/server.go
+++ b/server/server.go
@@ -35,0 +36,2 @@ func (b *Backend) AddUser(ctx context.Context, user *pbExample.User) (*types.Emp
+ var empty = &types.Empty{}
+
@@ -47 +49 @@ func (b *Backend) AddUser(ctx context.Context, user *pbExample.User) (*types.Emp
- return nil, detSt.Err()
+ return empty, detSt.Err()
@@ -49 +51 @@ func (b *Backend) AddUser(ctx context.Context, user *pbExample.User) (*types.Emp
- return nil, st.Err()
+ return empty, st.Err()
@@ -55 +57 @@ func (b *Backend) AddUser(ctx context.Context, user *pbExample.User) (*types.Emp
- return nil, status.Error(codes.FailedPrecondition, "user already exists")
+ return empty, status.Error(codes.FailedPrecondition, "user already exists")
@@ -66 +68 @@ func (b *Backend) AddUser(ctx context.Context, user *pbExample.User) (*types.Emp
- return nil, nil
+ return empty, nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment