tools / godep

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

Cause error when work with project which doesn't use godep #539

Closed lnshi closed 6 years ago

lnshi commented 7 years ago
*"lsync/api".LsyncServer does not implement lsync.LsyncServer (wrong type for HealthCheck method)
    have HealthCheck("lsync/vendor/golang.org/x/net/context".Context, *microservice.Empty) (*microservice.HealthCheckRes, error)
    want HealthCheck("golang.org/x/net/context".Context, *microservice.Empty) (*microservice.HealthCheckRes, error)

See "lsync/vendor/golang.org/x/net/context".Context vs "golang.org/x/net/context".Context, they are exactly same package, just because that I use godep so the path goes to vender/..., and the other project import it directly from $GOPATH, then the compiler report type error...

Any elegant way to deal with this?

benbenedek commented 7 years ago

I'm having a similar issue.

go version go1.8.1 linux/amd64```

``` ubuntu@box220:~/url_unfurl$ godep version
godep v79 (linux/amd64/go1.8.1) ```

ubuntu@box220:~/url_unfurl$ make godep restore ./... godep: [WARNING]: godep should only be used inside a valid go package directory and godep: [WARNING]: may not function correctly. You are probably outside of your $GOPATH. godep: [WARNING]: Current Directory: /home/ubuntu/url_unfurl godep: [WARNING]: $GOPATH: /home/ubuntu/.go_workspace:/usr/local/go_workspace go build -o go_unfurl_service ./main/service.go

command-line-arguments

main/service.go:27: cannot use router (type "github.com/gin-gonic/gin".Engine) as type "github.com/fiverr/url_unfurl/vendor/github.com/gin-gonic/gin".Engine in argument to service.Routes make: *** [go_unfurl_service] Error 2

jonathanfishner commented 6 years ago

מה אני חווה פה ? @fiverrben

huangjiuyuan commented 6 years ago

I have encountered the same issue.

freeformz commented 6 years ago

I am closing this issue because the repo is going to be archived.