{"action":"created","issue":{"url":"https://api.github.com/repos/docker/distribution/issues/2186","repository_url":"https://api.github.com/repos/docker/distribution","labels_url":"https://api.github.com/repos/docker/distribution/issues/2186/labels{/name}","comments_url":"https://api.github.com/repos/docker/distribution/issues/2186/comments","events_url":"https://api.github.com/repos/docker/distribution/issues/2186/events","html_url":"https://github.com/docker/distribution/pull/2186","id":206129649,"number":2186,"title":"convert ALL the fmt.Errorf to errors.New if there is no need to format the string","user":{"login":"kevinetc123","id":25165478,"avatar_url":"https://avatars.githubusercontent.com/u/25165478?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinetc123","html_url":"https://github.com/kevinetc123","followers_url":"https://api.github.com/users/kevinetc123/followers","following_url":"https://api.github.com/users/kevinetc123/following{/other_user}","gists_url":"https://api.github.com/users/kevinetc123/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinetc123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinetc123/subscriptions","organizations_url":"https://api.github.com/users/kevinetc123/orgs","repos_url":"https://api.github.com/users/kevinetc123/repos","events_url":"https://api.github.com/users/kevinetc123/events{/privacy}","received_events_url":"https://api.github.com/users/kevinetc123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-02-08T08:39:09Z","updated_at":"2017-02-21T22:55:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/distribution/pulls/2186","html_url":"https://github.com/docker/distribution/pull/2186","diff_url":"https://github.com/docker/distribution/pull/2186.diff","patch_url":"https://github.com/docker/distribution/pull/2186.patch"},"body":"as the Go source said , `fmt.Errorf` is just the combination of `fmt.Sprintf` and `errors.New`:\r\n```go\r\n// Errorf formats according to a format specifier and returns the string\r\n// as a value that satisfies error.\r\nfunc Errorf(format string, a ...interface{}) error {\r\n\treturn errors.New(Sprintf(format, a...))\r\n}\r\n```\r\nSigned-off-by: kaiwentan <kaiwentan@harmonycloud.cn>\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/docker/distribution/issues/comments/281509640","html_url":"https://github.com/docker/distribution/pull/2186#issuecomment-281509640","issue_url":"https://api.github.com/repos/docker/distribution/issues/2186","id":281509640,"user":{"login":"dmcgowan","id":169601,"avatar_url":"https://avatars.githubusercontent.com/u/169601?v=3","gravatar_id":"","url":"https://api.github.com/users/dmcgowan","html_url":"https://github.com/dmcgowan","followers_url":"https://api.github.com/users/dmcgowan/followers","following_url":"https://api.github.com/users/dmcgowan/following{/other_user}","gists_url":"https://api.github.com/users/dmcgowan/gists{/gist_id}","starred_url":"https://api.github.com/users/dmcgowan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmcgowan/subscriptions","organizations_url":"https://api.github.com/users/dmcgowan/orgs","repos_url":"https://api.github.com/users/dmcgowan/repos","events_url":"https://api.github.com/users/dmcgowan/events{/privacy}","received_events_url":"https://api.github.com/users/dmcgowan/received_events","type":"User","site_admin":false},"created_at":"2017-02-21T22:55:59Z","updated_at":"2017-02-21T22:55:59Z","body":"I would like to see this change be part of a larger move to `github.com/pkg/errors`. This would also entail updating the imports and using wrap. Just changing `fmt.Errorf` to `errors.New` is not providing any benefit to the code, however switching to `github.com/pkg/errors` does provide a clear benefit and would also entail switching all `fmt.Errorf` to `errors.Errorf` and wrap when providing useful contextual information."}}
{"actor":{"display_login":"dmcgowan"}}