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

Only minor changes #601

Merged
merged 3 commits into from
Aug 2, 2018
Merged

Only minor changes #601

merged 3 commits into from
Aug 2, 2018

Conversation

xyproto
Copy link
Contributor

@xyproto xyproto commented Jul 31, 2018

  • 50 fewer lines
  • introducing the must function and defer in main.go
  • favoring the "early return" style, which allows for reduction of indentation levels
  • avoiding named returns in a couple of places (but there is not much of a difference for these particular cases)

Accept or reject at will.

Thanks for creating yay!

cmd.go Outdated
err = numberMenu(cmdArgs.targets)

return
return numberMenu(cmdArgs.targets)
}

func handleSync() (err error) {
Copy link
Owner

Choose a reason for hiding this comment

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

If these changes are made, it is not needed to name the return

Copy link
Contributor Author

@xyproto xyproto Jul 31, 2018

Choose a reason for hiding this comment

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

Agree, updated the pull request.

Copy link
Owner

@Jguer Jguer left a comment

Choose a reason for hiding this comment

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

I really wish you had separated the changes to main.go into a different pull request since it's a bit more than syntactic fluff. I'll still take care to review everything since it's all over the place

@xyproto
Copy link
Contributor Author

xyproto commented Jul 31, 2018

The desired granularity for pull requests differ from project to project, and is hard to specify in the contribution guidelines.

@xyproto
Copy link
Contributor Author

xyproto commented Jul 31, 2018

Split out the changes to main.go to #602.

Copy link
Owner

@Jguer Jguer left a comment

Choose a reason for hiding this comment

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

I'm okay with it, I think it has 0 impact on speed, positive or negative and it doesn't seem harder to read. I'll wait on @Morganamilo to also chime in since this is pure syntactic sugar

@Morganamilo
Copy link
Contributor

As long as this is done consistently I don't mind. Might wanna rebase this against #585 though, as that's gonna be the next thing that gets merged as soon a we get a release.

@Morganamilo Morganamilo merged commit 0746d28 into Jguer:master Aug 2, 2018
@xyproto
Copy link
Contributor Author

xyproto commented Aug 2, 2018

Thanks for merging!

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