tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.54k stars 454 forks source link

"godep save" do not copy the sub directory #533

Closed zhengyhn closed 7 years ago

zhengyhn commented 7 years ago

Expected behavior

godep save should copy the sub directory of "github.com/yanyiwu/gojieba" source

Actual behavior

godep save only copy the ".go" files of "github.com/yanyiwu/gojieba" source

Steps to reproduce behavior

Make a new file with dependence of "github.com/yanyiwu/gojieba" go get github.com/yanyiwu/gojieba godep save

Note: the package "github.com/yanyiwu/gojieba" needs the dependences "deps" and "dict" sub directory in its source directory. But godep do not copy it.

godep version output

godep v78 (darwin/amd64/go1.7.5)

go version output

go version go1.7.5 darwin/amd64

Contents of Godeps.json file

{
        "ImportPath": "logSearcher",
        "GoVersion": "go1.7",
        "GodepVersion": "v78",
        "Deps": [
                {
                        "ImportPath": "github.com/yanyiwu/gojieba",
                        "Comment": "v1.0.0-2-g6a24846",
                        "Rev": "6a24846202b27f47819bf5f7ab21c8629a9e1f4a"
                }
        ]
}
freeformz commented 7 years ago

This is by design. godep only records go packages and any license files it can find.

Possible work arounds:

  1. Make dict and deps (or their sub directories) actual go packages and have gojieba _ import them and they will be picked up.
  2. Use a tool such as go-bindata to embed the info into a go package as binary data. There are tools other than go-bindata as well.