docs/new-project.md
Once you have dep installed, we need to pick a root directory for our project. This is primarily about picking the right root import path, and corresponding directory beneath $GOPATH/src, at which to situate your project. There are four basic possibilities:
$GOPATH/src/github.com/golang/dep.$GOPATH/src will do.$GOPATH/src is the root. Dep does not currently support this - it needs a non-empty import path to treat as the root of your project's import namespace.We'll assume the first case, as it's the most common. Create and move into the directory:
$ mkdir -p $GOPATH/src/github.com/me/example
$ cd $GOPATH/src/github.com/me/example
Now, we'll initialize the project:
$ dep init
$ ls
Gopkg.toml Gopkg.lock vendor/
In a new project like this one, both files and the vendor directory will be effectively empty.
This would also be a good time to set up a version control, such as git. While dep in no way requires version control for your project, it can make inspecting the changes made by normal dep operations easier. Plus, it's basically best practice #1 of modern software development!
At this point, our project is initialized, and we're ready to start writing code. You can open up a .go file in an editor and start hacking away. Or, after creating your first .go file, you can go ahead and pre-populate your vendor directory with some projects that you already know that you'll need:
$ dep ensure -add github.com/foo/bar github.com/baz/quux
Now you're ready to move on to Daily Dep!