Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement grpc create user #192

Merged
merged 4 commits into from
May 22, 2017
Merged

Implement grpc create user #192

merged 4 commits into from
May 22, 2017

Conversation

aguerra
Copy link
Contributor

@aguerra aguerra commented May 18, 2017

  • Implement create user
  • Remove go-swagger implementation
  • Clean up

This change is Reviewable

Use real storage.User struct.
@@ -99,12 +88,45 @@ func deleteUser(cmd *cobra.Command, args []string) {
fmt.Println("User deleted")
}

func createUser(cmd *cobra.Command, args []string) {
name, _ := cmd.Flags().GetString("name")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we just ignoring errors on all input parsing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy pasta from previous PR's, I will take a look into it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't do it now.
We can check for unexpected input errors in another PR.

if err := dbu.DB.Save(u).Error; err != nil {
return err
}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about:

- if err := dbu.DB.Save(u).Error; err != nil {
-     return err
- }
- return nil
+ return dbu.DB.Save(u).Error

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy 👍

Copy link
Contributor

@drgarcia1986 drgarcia1986 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@drgarcia1986 drgarcia1986 merged commit b8cb08e into master May 22, 2017
@drgarcia1986 drgarcia1986 deleted the ag-create-user-grpc branch May 22, 2017 13:38
@drgarcia1986 drgarcia1986 mentioned this pull request Jun 2, 2017
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants