Port go get funcionality to other project

I’d like to port the go get functionality to another open source project. The motivation is mainly onboarding and ecosystem folder defaults.

I conceptually understand the execution logic of get.go. However, I’m rather new to golang.

I’d like to ask, which strategy I should adopt to splitting out this functionality?

Some ideas I had:

  • Copying the go repo and splitting out the src/cmd subfolder?
  • Trying to isolate the get.go file which seems pretty hard for a newcomer?

Thanks for any tips and ideas you might be willing to share.

Some of the logic for “go get” can be found in https://godoc.org/golang.org/x/tools/go/vcs .

However, if you are new to go, I would stay away from trying to modify “go” or “go get”. Specifically, are you concerned with GOPATH and the requirement for source directories?

As developers we like to fix things. However, as a user, could you state the problems you are facing?

Yes, this is actually a sweet spot I’m longing for. I am a freshmen to intermediate developer and active in another ecosystems. I want to help people with getting started, and go just does so many things right.

Thanks for the link, I think this is part of what I’m looking for, I already succeeded in compiling the go command independently on a separate repo. Easy, thanks to go :smile:

This made me think of even porting other functionality to the ecosystem. If you’re interested, here is the repo: GitHub - blaggacao/godoo: `go get` for odoo: godoo

I looked at the repo, but I’m not clear what you are trying to do.

If you simply want to get rid of GOPATH, look into https://getgb.io/ . I would recommend however that you teach new Go programmers how to use GOPATH and go tools. Once done ALL projects everywhere can be compiled. No env setup, just fetched and built. packages and symbols can be renamed over all projects.

Recommendation: If you can’t work with GOPATH, use gb (https://getgb.io) but strong preference to just learning what go can do.

Haha, sry, if I was not clear.

My goal is create a new command line tool for managing a projects git repos and other tooling, just as the go command does for the go language.

So instead of writing everything from scratch, I thought it would be better to strip down the go command to what I actually want and adapt it’s functionality to our ecosystem…

Thanks for your hints and help! The good thing compiling only this go command folder just worked fine, so I have a prototype which I can adapt.

You may want to look into:



and the go 1.5 vendor folder.
I’m sure any one of these projects would love to see additional help. It might be more productive to raise issues and PR then to try to start yet another tool.

Cool, thank you! I’ll have a look at it and see how I can fit in to make this work in a python environment… I’m not sure if you got me completely right though. :sunny:

May I ask you, to help me with a little pointer to where build.Context is created? I get it’s contents through the mailgun’s godebug debugger, but I’m not able to track down it’s creation…

Just to be clear, I do not want to duplicate any work or something of that kind. I like the go get so much, that I would like to have it on my own project, which is a customary python framework for business application, called OpenObject / OpenERP / Odoo. And learn go (!) by porting it.

Ps.: I had a closer look at your repo, and got by this design document: https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo/edit
I yet have to think about if this is a useful concept to port, but I think for what I want to do, a subset of the standard go command would be just great…

Never, mind. I found it and working my way through: https://golang.org/src/go/build/build.go Wan’t that hard, actually… :blush:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.