Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Respect the GO15VENDOREXPERIMENT env variable #244

Closed
wants to merge 5 commits into from
Closed

Conversation

freeformz
Copy link

The GO15VENDOREXPERIMENT env variable is how the vendor experiment is
enabled and we should respect that and use it when the user has it set.

@kr ... I think this is something (with maybe a little more work) we should actually incorporate sooner rather than later. Thoughts?

The GO15VENDOREXPERIMENT env variable is how the vendor experiment is
enabled and we should respect that and use it when the user has it set.
@kr
Copy link
Member

kr commented Jul 11, 2015

I agree. What else do you think it would need?

var sep = "/Godeps/_workspace/src/"
var VendorExperiment = os.Getenv("GO15VENDOREXPERIMENT") == "1"

func init() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest the signature defaultSep(experiment bool) string for this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I likened it to flag handling, which is done elsewhere in init functions.

Are you suggesting that init should call defaultSep(VendorExperiment) to set sep or that everywhere sep is currently used it should be replaced with defaultSep(VendorExperiment) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm suggesting the first, e.g. var sep = defaultSep(VendorExperiment).

Flags are defined in init functions only because they have to to avoid a cycle. (Try changing it to var saveR = cmdSave.Flag.Bool(...) to see what happens.)

Edward Muller added 2 commits July 11, 2015 09:31
-Don't use an init function
-Added/updated some docs
@freeformz
Copy link
Author

@kr Updated with suggestions.

Re: What more. TBH I think this is enough for now. It's usable for me w/o changes to my workflow (modulo golang/go#11659 anyway).

@freeformz
Copy link
Author

@kr just to be clear I don't think that golang issue should block. Just pointing it out.

@kr
Copy link
Member

kr commented Jul 12, 2015

LGTM

Edward Muller added 2 commits July 11, 2015 21:39
@freeformz
Copy link
Author

@kr I also added docs and fixed an issue, so if you could take another look ++.

@kr
Copy link
Member

kr commented Jul 12, 2015

What do you think about putting Godeps.json inside vendor? It would mean more work for other tools that read that file (e.g. the Heroku buildpack) but it would produce less clutter in a project's root directory.

Either way, LGTM

@freeformz
Copy link
Author

@kr I think I'd rather leave the file where it is. For now at least.

@kr
Copy link
Member

kr commented Jul 13, 2015

Looks like this was closed in fe7138c.

@freeformz
Copy link
Author

@kr Yeah, sorry I got distracted after the merge with other work.

@pierrre
Copy link

pierrre commented Jul 18, 2015

Does this mean that godep go build is equivalent to go build if GO15VENDOREXPERIMENT is set?

@freeformz
Copy link
Author

@pierrre Not 100%, but essentially yes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants