Failed to migrate .go file when goose lib in 'vendor' directory.

Issue #63 new
chenye liang created an issue

Hi @liamstask, I failed to write a postgres migration program based on your goose project. The error message is like this:

2016/05/25 18:48:15 gob.Decode - gob: name not registered for interface: "github.com/liangchenye/goose-study-false/vendor/bitbucket.org/liamstask/goose/lib/goose.PostgresDialect"
exit status 1
2016/05/25 18:48:15 `go run` failed: exit status 1

I found it only fails when the goose project is in the vendor directory. Seems that gob.NewEncoder(&bb).Encode(conf) will record a full link: "github.com/liangchenye/goose-study-false/vendor/bitbucket.org/liamstask/goose/lib/goose. So if the bb buf is used in the same program, gob.NewDecode succeed. But goose is actually running the migration go code in another program which uses a goose lib in the GOPATH. Thus gob.NewDecode fails.

I write two projects to explain my issue: The failed project in which use goose in the 'vendor' directory. https://github.com/liangchenye/goose-study-false The success project in which use goose in the GOPATH directory. https://github.com/liangchenye/goose-study

Thanks

Comments (5)

  1. Log in to comment