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/vgo: access to details of packages etc #23951

Closed
dave opened this issue Feb 20, 2018 · 5 comments

Comments

@dave
Copy link
Contributor

commented Feb 20, 2018

It would be great to have API access to some of the internals of the new vgo tool.

I recently spent a good deal of time forking go get and replacing the calls to git with the go-git library, so I could get a package and dependencies to memory rather than the filesystem (see here). It was neither fun nor pretty.

The new architecture of removing the external tools and transferring zip files around over HTTP lends itself rather well to this... I'd love to be able to stream a module zip file to a io.Reader without having to fork internal packages.

@gopherbot gopherbot added this to the Unreleased milestone Feb 20, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2018

Please don't fork internal packages. We're going to build out a good command-line API for getting this stuff out of the go command directly. It's only day 1. :-)

@rsc rsc modified the milestones: Unreleased, vgo Feb 20, 2018

@rsc rsc changed the title x/vgo: Programmatic access x/vgo: access to details of packages etc Feb 20, 2018

@dave

This comment has been minimized.

Copy link
Contributor Author

commented Feb 20, 2018

Wait - not sure you understand my request... I'd like to trigger the go commands from code, not a command line tool...

e.g.

zipbuf := &bytes.Buffer{}
gotool.GetModule(zipbuf, "github.com/foo/bar")
// downloads module zip and writes to zipbuf
@dave

This comment has been minimized.

Copy link
Contributor Author

commented Feb 20, 2018

It's only day 1.

Totally understand it's just a prototype!

@dave dave referenced this issue Feb 26, 2018
@rsc

This comment has been minimized.

Copy link
Contributor

commented Apr 2, 2018

I'd like to trigger the go commands from code, not a command line tool...

Sorry, but I'm not willing to support Go API access, because then if you have a stale tool then your tool will do old things. In contrast if your tool runs the go command-line to find out what it needs, then it will not need to be updated after and stay in sync with each Go release.

We're going to work on command-line API, as I said.

@rsc rsc closed this Apr 2, 2018

@dave

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2018

I understand. It's a whole different level of effort maintaining a backwards compatible API than a command line tool. Thanks for looking into this.

@golang golang locked and limited conversation to collaborators Apr 2, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.