Skip to content

Codestyle#300

Merged
technoweenie merged 14 commits intogit-lfs:masterfrom
michael-k:codestyle
May 13, 2015
Merged

Codestyle#300
technoweenie merged 14 commits intogit-lfs:masterfrom
michael-k:codestyle

Conversation

@michael-k
Copy link
Contributor

This is my first contribution to this project, so I'm not sure what's appreciated and what's not. Please let me know. I'm happy to change the PR in any way necessary.

As I worked myself through the codebase I made some changes to the codestyle and did some minor refactoring (switched if-else; returned nil as payload with error). I split it in small commits to make it easier to follow.

@technoweenie
Copy link
Contributor

Looks good to me. There's a lot of old Go code of mine in here written before I understood the popular Go conventions.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're going to go with this style of import block (which I am in favor of, and is the only annoying difference between goimports and go fmt), then we should do it this way everywhere.

@rubyist
Copy link
Contributor

rubyist commented May 12, 2015

👍 for me, other than hoping to see those import blocks consistent across the code base.

@michael-k
Copy link
Contributor Author

Thanks for the feedback. I'll change the imports.

@technoweenie
Copy link
Contributor

I don't think the imports are necessary to change in this PR. Instead, I think we should setup a separate PR that somehow bundles goimports, and uses it in place of script/fmt. I'd probably just add the go get in script/bootstrap.

$ go get golang.org/x/tools/cmd/goimports

@rubyist
Copy link
Contributor

rubyist commented May 12, 2015

I think this PR should leave them consistent, whichever way we go. I'm not entirely convinced bundling goimports is necessary, go fmt will honor the spaced blocks if it encounters them. I could be persuaded otherwise, though. I honestly don't use script/fmt and just run that stuff from my editor.

@technoweenie
Copy link
Contributor

Actually, you do use script/fmt, it's called during script/test :)

I'm totally cool with consistent imports in this PR.

On Tue, May 12, 2015 at 10:25 AM, Scott Barron notifications@github.com
wrote:

I think this PR should leave them consistent, whichever way we go. I'm not
entirely convinced bundling goimports is necessary, go fmt will honor the
spaced blocks if it encounters them. I could be persuaded otherwise,
though. I honestly don't use script/fmt and just run that stuff from my
editor.


Reply to this email directly or view it on GitHub
#300 (comment).

Rick Olson

michael-k added 7 commits May 13, 2015 01:38
I needed some extra time to understand what was happening.  In my
opinion, the control flow is easier to follow when checking for
err != nil, as this is the convention in go.
@michael-k
Copy link
Contributor Author

I removed the import reformatting from this PR. (That's what I meant with “I'll change the imports.”)

@technoweenie
Copy link
Contributor

Thanks! I think we'll just do that in an isolated PR.

technoweenie added a commit that referenced this pull request May 13, 2015
@technoweenie technoweenie merged commit 29630a5 into git-lfs:master May 13, 2015
@technoweenie technoweenie mentioned this pull request May 13, 2015
38 tasks
@michael-k michael-k deleted the codestyle branch May 13, 2015 19:35
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