Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Installing not yet used packages #303

Closed
Alexendoo opened this issue Mar 8, 2017 · 2 comments
Closed

Installing not yet used packages #303

Alexendoo opened this issue Mar 8, 2017 · 2 comments

Comments

@Alexendoo
Copy link

go version go1.8 linux/amd64

I was starting a new project and decided to give dep a whirl, so this experience is from my first moments with the tool

I started with a noop main.go, ran dep init which produced an empty lock/manifest which seemed about right, then attempted dep ensure github.com/gorilla/mux which gave an error of sorts, with no packages being added to vendor/

dep: No constraint or alternate source specified for "github.com/gorilla/mux", omitting from manifest

So I attempted to manually specify a constraint: dep ensure github.com/gorilla/mux@^1.3.0 which gave no output but did add the dependency to the manifest. However no packages were added to vendor or the lock file.

With a bit of trial and error I found that I have to use the package in my project before it exists to have dep install it.

The main reason I want to install a package first as it allows editors to provide code completion, but it's also just habit from other tools/languages (npm, cargo, glide etc)

@sdboyer
Copy link
Member

sdboyer commented Mar 8, 2017

Thanks for trying dep, and for providing the feedback!

Yeah, we've been back and forth over this quite a lot. I honestly can't even remember where we've landed right now.

There's an existing mechanism by which we could accomplish the outcome you want pretty easily - see #36. The question has mostly about whether we can do it in a way that won't have weird gotchas for folks, and that won't make the command set awkward, or have the same literal command have drastically different behavior depending on disk state.

It should be easier to do this under the new approach to the command set we're taking. That's being discussed in #277.

@sdboyer
Copy link
Member

sdboyer commented Aug 10, 2017

#489 brought us dep ensure -add, so this is now addressed!

@sdboyer sdboyer closed this as completed Aug 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants