{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/11497","labels_url":"https://api.github.com/repos/golang/go/issues/11497/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/11497/comments","events_url":"https://api.github.com/repos/golang/go/issues/11497/events","html_url":"https://github.com/golang/go/issues/11497","id":92429922,"number":11497,"title":"cmd/gofmt: inconsistent spacing on slice indices","user":{"login":"tgrosinger","id":597386,"avatar_url":"https://avatars.githubusercontent.com/u/597386?v=3","gravatar_id":"","url":"https://api.github.com/users/tgrosinger","html_url":"https://github.com/tgrosinger","followers_url":"https://api.github.com/users/tgrosinger/followers","following_url":"https://api.github.com/users/tgrosinger/following{/other_user}","gists_url":"https://api.github.com/users/tgrosinger/gists{/gist_id}","starred_url":"https://api.github.com/users/tgrosinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgrosinger/subscriptions","organizations_url":"https://api.github.com/users/tgrosinger/orgs","repos_url":"https://api.github.com/users/tgrosinger/repos","events_url":"https://api.github.com/users/tgrosinger/events{/privacy}","received_events_url":"https://api.github.com/users/tgrosinger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-01T16:37:38Z","updated_at":"2015-07-02T16:27:19Z","closed_at":"2015-07-01T22:59:08Z","body":"**What version of Go are you using (go version)?** `go version go1.4.2 linux/amd64`\r\n**What operating system and processor architecture are you using?** Ubuntu 14.04\r\n**What did you do?** Run `gofmt` on below code examples\r\n**What did you expect to see?** Consistent spacing of slice indices\r\n\r\nThese are two lines within the same function. They vary slightly, but the interesting part is the `[1:len(key-1]` which has inconsistent spacing. Adding spaces to the first one will result in them being removed when `gofmt` is run, and removing the spaces from the second will only have them added back.\r\n\r\nIf this is not a bug, please let me know what difference here is causing the spacing to change.\r\n\r\n```Go\r\nreturn \"?\" + key[1:len(key)-1]\r\n```\r\n\r\n```Go\r\nkey = key[1 : len(key)-1]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/118084852","html_url":"https://github.com/golang/go/issues/11497#issuecomment-118084852","issue_url":"https://api.github.com/repos/golang/go/issues/11497","id":118084852,"user":{"login":"tgrosinger","id":597386,"avatar_url":"https://avatars.githubusercontent.com/u/597386?v=3","gravatar_id":"","url":"https://api.github.com/users/tgrosinger","html_url":"https://github.com/tgrosinger","followers_url":"https://api.github.com/users/tgrosinger/followers","following_url":"https://api.github.com/users/tgrosinger/following{/other_user}","gists_url":"https://api.github.com/users/tgrosinger/gists{/gist_id}","starred_url":"https://api.github.com/users/tgrosinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgrosinger/subscriptions","organizations_url":"https://api.github.com/users/tgrosinger/orgs","repos_url":"https://api.github.com/users/tgrosinger/repos","events_url":"https://api.github.com/users/tgrosinger/events{/privacy}","received_events_url":"https://api.github.com/users/tgrosinger/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T16:27:19Z","updated_at":"2015-07-02T16:27:19Z","body":"Hmm, I understand that there may be times where one formatting is better than another. But in this case the core piece of the line is exactly the same in both cases. Is there a more specific reasoning that causes this particular difference?"}}