Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffalo build failed with pop module "v5" in buffalo_build_main.go.plush template #1875

Open
Prnyself opened this issue Jan 14, 2020 · 0 comments
Assignees
Labels
bug

Comments

@Prnyself
Copy link

@Prnyself Prnyself commented Jan 14, 2020

Description

My app try to use pop with module "github.com/gobuffalo/pop/v5". When I build my app with buffalo build, the generated buffalo_build_main.go file encounters an error as below:
./buffalo_build_main.go:95:44: cannot use models.DB (type *"github.com/gobuffalo/pop/v5".Connection) as type *"github.com/gobuffalo/pop".Connection in argument to "github.com/gobuffalo/pop".NewMigrationBox

I check the code in buffalo/genny/build/templates/buffalo_build_main.go.plush, and find that it only checks the WithPop env, for pop module, but not the pop/v5.

I think we should check the version of pop, and generate different import in the template.

Steps to Reproduce the Problem

Please describe in painful detail what you did (so others can play along with you) to get to this point. This includes things like the exact command(s) you used, or the curl command you used, that sort of thing.

  1. import "github.com/gobuffalo/pop/v5" in your app
  2. buffalo build

Expected Behavior

Check the version of pop and generate differently in "import".

Actual Behavior

No matter what the version is, it always generates "github.com/gobuffalo/pop".

Info

### Buffalo Version
v0.14.2

### App Information
Pwd=/Users/lance/Desktop/QingCloud/projects/modgo/qingstor-zero-web
Root=/Users/lance/Desktop/QingCloud/projects/modgo/qingstor-zero-web
GoPath=/Users/lance/Desktop/QingCloud/projects/go
PackagePkg=qingstor-zero-web
ActionsPkg=qingstor-zero-web/actions
ModelsPkg=qingstor-zero-web/models
GriftsPkg=qingstor-zero-web/grifts
WithModules=true
Name=qingstor-zero-web
Bin=bin/qingstor-zero-web
VCS=git
WithPop=true
WithSQLite=false
WithDep=false
WithWebpack=true
WithNodeJs=true
WithYarn=true
WithDocker=true
WithGrifts=true
AsWeb=true
AsAPI=false
PackageJSON={map[]}

### Go Version
go version go1.13.5 darwin/amd64

@stanislas-m stanislas-m added the bug label Jan 14, 2020
@stanislas-m stanislas-m self-assigned this Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.