{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/20786","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/20786/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/20786/comments","events_url":"https://api.github.com/repos/golang/go/issues/20786/events","html_url":"https://github.com/golang/go/issues/20786","id":238330609,"number":20786,"title":"fmt: pp should implement WriteString()","user":{"login":"pierrre","id":131535,"avatar_url":"https://avatars3.githubusercontent.com/u/131535?v=4","gravatar_id":"","url":"https://api.github.com/users/pierrre","html_url":"https://github.com/pierrre","followers_url":"https://api.github.com/users/pierrre/followers","following_url":"https://api.github.com/users/pierrre/following{/other_user}","gists_url":"https://api.github.com/users/pierrre/gists{/gist_id}","starred_url":"https://api.github.com/users/pierrre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierrre/subscriptions","organizations_url":"https://api.github.com/users/pierrre/orgs","repos_url":"https://api.github.com/users/pierrre/repos","events_url":"https://api.github.com/users/pierrre/events{/privacy}","received_events_url":"https://api.github.com/users/pierrre/received_events","type":"User","site_admin":false},"labels":[{"id":150880243,"url":"https://api.github.com/repos/golang/go/labels/HelpWanted","name":"HelpWanted","color":"fbca04","default":false},{"id":373399998,"url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false},{"id":150880191,"url":"https://api.github.com/repos/golang/go/labels/Performance","name":"Performance","color":"ededed","default":false},{"id":626114820,"url":"https://api.github.com/repos/golang/go/labels/release-blocker","name":"release-blocker","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/56","html_url":"https://github.com/golang/go/milestone/56","labels_url":"https://api.github.com/repos/golang/go/milestones/56/labels","id":2473074,"number":56,"title":"Go1.10","description":"","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":843,"closed_issues":211,"state":"open","created_at":"2017-04-21T19:22:29Z","updated_at":"2017-09-03T21:48:09Z","due_on":"2018-01-31T08:00:00Z","closed_at":null},"comments":11,"created_at":"2017-06-24T17:28:32Z","updated_at":"2017-09-04T23:27:34Z","closed_at":null,"author_association":"NONE","body":"### What version of Go are you using (`go version`)?\r\n1.9beta1\r\n\r\n### What did you do?\r\n\r\nIn my code, I'm implementing `fmt.Formatter`.\r\nIn order to write a `string` to the `fmt.State`, I'm calling `io.WriteString()`.\r\nI know that this function has an optimization that allows to call `WriteString()` if `w` implements it.\r\nSadly, in my case the \"real\" type of `fmt.State` is `fmt.pp`.\r\n`fmt.pp` only has `Write()`.\r\n\r\n### What did you expect to see?\r\n\r\nI think we should add:\r\n```go\r\nfunc (p *pp) WriteString(s string) (ret int, err error) {\r\n\tp.buf.WriteString(s)\r\n\treturn len(s), nil\r\n}\r\n```\r\nin my case, it greatly improve performance and reduces memory allocation.\r\nWe could also implement `WriteByte()` and `WriteRune()`, since `fmt.buffer` has these methods."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/327038737","html_url":"https://github.com/golang/go/issues/20786#issuecomment-327038737","issue_url":"https://api.github.com/repos/golang/go/issues/20786","id":327038737,"user":{"login":"stemar94","id":9718292,"avatar_url":"https://avatars0.githubusercontent.com/u/9718292?v=4","gravatar_id":"","url":"https://api.github.com/users/stemar94","html_url":"https://github.com/stemar94","followers_url":"https://api.github.com/users/stemar94/followers","following_url":"https://api.github.com/users/stemar94/following{/other_user}","gists_url":"https://api.github.com/users/stemar94/gists{/gist_id}","starred_url":"https://api.github.com/users/stemar94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stemar94/subscriptions","organizations_url":"https://api.github.com/users/stemar94/orgs","repos_url":"https://api.github.com/users/stemar94/repos","events_url":"https://api.github.com/users/stemar94/events{/privacy}","received_events_url":"https://api.github.com/users/stemar94/received_events","type":"User","site_admin":false},"created_at":"2017-09-04T23:27:34Z","updated_at":"2017-09-04T23:27:34Z","author_association":"NONE","body":"I mailed another way on how to resolve this by. gopherbot will notice soon."}}
{"actor":{"display_login":"stemar94"}}