ffjson icon indicating copy to clipboard operation
ffjson copied to clipboard

Type mismatch due to vendored dependency

Open volker48 opened this issue 9 years ago • 1 comments

ffjson seems to be getting confused due to the vendor folder in another project.

cannot use event.ID (type "bitbucket.org/50onred/projectA/vendor/github.com/satori/go.uuid".UUID) as type "github.com/satori/go.uuid".UUID in assignment

The code compiles just fine with go build, but when I run ffjson on my file to generate code it fails. It looks like the vendor folder of the other project is throwing it off. If I remove this folder bitbucket.org/50onred/hopper/vendor/github.com/satori/go.uuid".UUID then it works as expected.

To reproduce:

  1. Create two folders in $GOPATH projA and projB
  2. In projA create a struct that has a field with type "github.com/satori/go.uuid".UUID
  3. In projB create a struct with a field with type "github.com/satori/go.uuid".UUID
  4. In the code of projB try and assign uuid field from struct in projA to uuid field in struct from projB
  5. Run ffjson on .go file in projB containing struct.

volker48 avatar Apr 27 '16 19:04 volker48

How did you solve this problem ? I am getting similar problem.

sourabh3b avatar Feb 13 '17 15:02 sourabh3b