Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
fmt: pp should implement WriteString() #20786
What version of Go are you using (
io.WriteString() uses a runtime check so it looks like it should work without changing the State Interface definition. For go2 we could then think about wether it makes sense to update the State Interface.
@nikhita go ahead if you want too. Please add email@example.com and firstname.lastname@example.org as reviewers. We can review before go1.10 but we can only submit when the code tree opens for go1.10 start of August.
Following up here instead of on the CL discussion.
I would also favor to leave the internal buffer methods unexposed and only implement WriteString on pp as the proposal suggested. As far as i know there has been not yet been data or a request to add more io methods beyond WriteString. Keeping the api footprint low imposes less constraints on internals for future changes and avoids needing to implement them explicitly on pp later if buffer is replaced by something with different interfaces for internal optimization.
If it is decided to expose all the io methods from the buffer it would be good to make sure that there are no regressions due to the compiler not optimizing all the overhead away for the internal use of those methods (e.g. due to inline budget changes).