-
Notifications
You must be signed in to change notification settings - Fork 484
golint: suggest for range when possible
#196
Conversation
`for _ = range` and `for _, _ = range` can be written as `for range` instead.
|
Thanks, but I'm not convinced this is particularly useful. |
|
"relatively recently" was over a year ago. I was hoping that adding the check would remind people that this is now possible. I think most people don't realize that it is. It's something that |
|
A year isn't much time in the scheme of things to make something a standard. Go has been a public project for over 6 years. Mere availability of a language construct does not make it stylistically wrong to use the longer form, and it's not golint's place to remind people of new features, only to flag poor style. Sorry, this doesn't pass muster. |
|
Fair enough. I'll be back in a year ;-) |
|
@dominikh Here we are. |
|
I am impressed. PTAL |
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
@dominikh can you reply to @googlebot ? |
|
I signed it. |
|
@googlebot cla? |
|
Hm. @googlebot seems stuck. Can you confirm with your existing CLA data and verify that your email is set on your git commits? Links in #196 (comment) |
|
I think I see what happened. I had signed the CLA on my gmail account a long time ago, and added my main email (dominik@honnef.co) as an alternate email address. A while back, I turned dominik@honnef.co into a Google Apps account, so it must've detached the address from the CLA. I have now effectively signed a second CLA, on the new account. |
|
CLAs look good, thanks! |
1 similar comment
|
CLAs look good, thanks! |
|
This PR (HEAD: 318343f) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/#/c/lint/+/96176 to see it. Tip: You can toggle comments from me using the |
|
Message from Andrew Bonventre: Patch Set 1: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/96176. |
|
Message from Andrew Bonventre: Patch Set 1: (1 comment) ping adonovan Please don’t reply on this GitHub thread. Visit golang.org/cl/96176. |
|
Message from Alan Donovan: Patch Set 1: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/96176. |
for range when possiblefor range when possible
|
Message from Gerrit Bot: Uploaded patch set 2: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/96176. |
|
Message from Gerrit Bot: Uploaded patch set 3: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/96176. |
for _ = range and for _, _ = range can be written as for range instead. Change-Id: I6d5e7aecce941260f4a4de294685f99d9ff48c09 GitHub-Last-Rev: 318343f GitHub-Pull-Request: #196 Reviewed-on: https://go-review.googlesource.com/96176 Reviewed-by: Alan Donovan <adonovan@google.com>
|
This PR is being closed because golang.org/cl/96176 has been merged. |
for _ = range and for _, _ = range can be written as
for range instead.