{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1736","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1736/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1736/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1736/events","html_url":"https://github.com/cockroachdb/cockroach/pull/1736","id":95940050,"number":1736,"title":"Remove `go-nyet` and clean up `err` scopes","user":{"login":"tamird","id":1535036,"avatar_url":"https://avatars.githubusercontent.com/u/1535036?v=3","gravatar_id":"","url":"https://api.github.com/users/tamird","html_url":"https://github.com/tamird","followers_url":"https://api.github.com/users/tamird/followers","following_url":"https://api.github.com/users/tamird/following{/other_user}","gists_url":"https://api.github.com/users/tamird/gists{/gist_id}","starred_url":"https://api.github.com/users/tamird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamird/subscriptions","organizations_url":"https://api.github.com/users/tamird/orgs","repos_url":"https://api.github.com/users/tamird/repos","events_url":"https://api.github.com/users/tamird/events{/privacy}","received_events_url":"https://api.github.com/users/tamird/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cockroachdb/cockroach/labels/PTAL","name":"PTAL","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-19T18:55:58Z","updated_at":"2015-07-20T19:25:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1736","html_url":"https://github.com/cockroachdb/cockroach/pull/1736","diff_url":"https://github.com/cockroachdb/cockroach/pull/1736.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/1736.patch"},"body":"Two commits here: first one removes go-nyet, second one is the part of #1735 that is uncontroversial in my opinion. Thought it'd be good to land this separately from ongoing discussion in #1735.\r\n\r\nThe main pattern to notice in the second commit is that `err` is always shadowed when used in a block scope, unless the assignment is explicitly intended to mutate (such as in the case of a named return). I think this makes things clearer, but others may disagree.\r\n\r\nThe second pattern to notice is the block scoping of `foo, err` when `foo` is only used to define a derivative value. In other words, `foo, err` have become block scoped in cases where it was convenient to leak `foo` or a derivative of `foo` into the wrapping scope from within the block."},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/122997473","html_url":"https://github.com/cockroachdb/cockroach/pull/1736#issuecomment-122997473","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1736","id":122997473,"user":{"login":"tamird","id":1535036,"avatar_url":"https://avatars.githubusercontent.com/u/1535036?v=3","gravatar_id":"","url":"https://api.github.com/users/tamird","html_url":"https://github.com/tamird","followers_url":"https://api.github.com/users/tamird/followers","following_url":"https://api.github.com/users/tamird/following{/other_user}","gists_url":"https://api.github.com/users/tamird/gists{/gist_id}","starred_url":"https://api.github.com/users/tamird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamird/subscriptions","organizations_url":"https://api.github.com/users/tamird/orgs","repos_url":"https://api.github.com/users/tamird/repos","events_url":"https://api.github.com/users/tamird/events{/privacy}","received_events_url":"https://api.github.com/users/tamird/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T19:25:49Z","updated_at":"2015-07-20T19:25:49Z","body":"> I wasn't aware that we had agreed to enforce no-shadowing in our code. I probably wasn't paying attention, but this seemed to just slip in from my perspective.\r\n\r\nYeah, this came out of my frustration fighting a bug that I introduced in a branch over the weekend (the tests caught it, thankfully). We haven't agreed on anything; I was hoping we'd reach agreement in this thread.\r\n\r\nI'm okay with shelving this until we can sort out the `go vet` bug."}}