Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cover: allow reading from an io.Reader #19404

Closed
peterebden opened this issue Mar 5, 2017 · 5 comments
Closed

x/tools/cover: allow reading from an io.Reader #19404

peterebden opened this issue Mar 5, 2017 · 5 comments
Labels
FrozenDueToAge Proposal-Accepted Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@peterebden
Copy link

The only interface available now is ParseProfiles which accepts a filename to read from. In cases where that data has already been read or is coming from somewhere other than a filesystem, it'd be nice to be able to parse it in-place rather than having to reread a file (or in the worst case write a file first).

Our use case is that we have a build tool that handles coverage across multiple languages, and so we read the data in and perform some simple heuristics to figure out how to parse it. That works fine for common JSON or XML formats, it'd be nice not to incur this inefficient re-read for Go.
I'm happy to send a pull request implementing this.

Compatibility

It will be easy to implement this while preserving the old interface as well.

@gopherbot
Copy link

CL https://golang.org/cl/37830 mentions this issue.

@rsc rsc changed the title Proposal: tools/cover should allow reading from an io.Reader x/tools/cover: allow reading from an io.Reader Mar 6, 2017
@rsc
Copy link
Contributor

rsc commented Mar 6, 2017

Leaving review of CL for @robpike.

@rsc
Copy link
Contributor

rsc commented Mar 6, 2017

Note that changes made in x/tools should be brought back into cmd/cover once completed.

@gopherbot gopherbot added this to the Unreleased milestone Mar 21, 2017
@gopherbot
Copy link

Change https://golang.org/cl/71890 mentions this issue: cover: Adding an interface to parse data from an arbitrary Reader.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
6543 added a commit to 6543-forks/tools that referenced this issue Sep 29, 2021
to let the cover tool be more flexible to integrate

Fixes golang/go#19404
@gopherbot
Copy link

Change https://golang.org/cl/336329 mentions this issue: cover: add function to parse profiles from io.Reader

@golang golang locked and limited conversation to collaborators Oct 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Proposal-Accepted Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants