This is a creation in Article, where the information may have evolved or changed.
About GODEP
Found that a lot of golang projects are used to GODEP as a package management tool, such as large-scale projects, such as Kubernetes, are using GODEP to rely on management operations, looked a bit like maven feeling, here to record the basic operation.
The first is the installation
Because of the network problem, goget when there is a package will not find, there are many alternative solutions, such as this
Basic use
Go Save
For example, to build a basic project, take Beego's example project. It is also important to note that go save is unsuccessful when you are not using version control and will report an error similar to the following:
godep: error while inspecting "/Users/Hessen/goworkspace/src/testBee/bapi": directory "/Users/Hessen/goworkspace/src" is not using a known version control system
The specific reasons for this article are explained in more detail. Always use the version Control tool to initialize the entire project first. After Godev save can see in the current directory generated Godeps folder, there is _workspace folder, storage of the source of the dependent package, as well as Godeps.json files, specifically describes the dependency relationship. The good thing about this is that you don't have to edit the description of the dependent package yourself, as Maven did, and it's automatically generated from the version control tool.
Go restore
The operation of restore and go save is done on the opposite side, such as Git on a project using GODEP, pull down, using GODEP restore can be godeps/ The dependent copies listed in Godeps.json are below the local gopath. One problem to note is that if there is already a related package installed, and some modifications have been made and some pull,request operations have been done, there may be some git related errors.