mweagle / Sparta

go microservices, powered by AWS Lambda
https://gosparta.io
MIT License
717 stars 48 forks source link

Support: Can't "go get" Sparta because of "github.com/AlecAivazis/survey" module #144

Closed alvaroloes closed 5 years ago

alvaroloes commented 5 years ago

I'm using go version 1.12 which have "go modules" enabled by default and I can't "go get" Sparta to do the sample application.

This can be reproduced by doing:

➜  go get github.com/mweagle/Sparta@v1.9.2    

Result:

go: finding github.com/dustin/go-broadcast latest
go: finding github.com/aws/aws-lambda-go/lambdacontext latest
go: finding github.com/google/pprof/driver latest
go: finding github.com/google/pprof latest
go: finding github.com/google/pprof/profile latest
go: finding github.com/aws/aws-sdk-go/aws/session latest
go: finding github.com/aws/aws-sdk-go/service/s3 latest
go: finding github.com/aws/aws-sdk-go/service/iam latest
go: finding github.com/aws/aws-sdk-go/aws latest
go: finding github.com/aws/aws-sdk-go/aws/awserr latest
go: finding github.com/aws/aws-sdk-go/service/ses latest
go: finding github.com/aws/aws-sdk-go/service/sts latest
go: finding github.com/aws/aws-sdk-go/service latest
go: finding github.com/aws/aws-sdk-go/service/sns latest
go: finding github.com/aws/aws-sdk-go/service/cloudformation latest
go: finding github.com/aws/aws-sdk-go/service/apigateway latest
go: finding github.com/aws/aws-sdk-go/service/s3/s3manager latest
go: finding github.com/aws/aws-sdk-go/service/cloudwatchlogs latest
go: finding github.com/aws/aws-sdk-go/service/codecommit latest
go: finding github.com/aws/aws-sdk-go/service/lambda latest
go: finding github.com/aws/aws-lambda-go/lambda latest
go: finding github.com/aws/aws-sdk-go/aws/request latest
go: finding github.com/mweagle/go-cloudcondenser latest
go: finding github.com/rivo/tview latest
go: finding github.com/hokaccha/go-prettyjson latest
go: finding github.com/mweagle/go-cloudformation latest
go: finding github.com/briandowns/spinner latest
go: github.com/AlecAivazis/survey@v1.8.4: parsing go.mod: unexpected module path "gopkg.in/AlecAivazis/survey.v1"
go: error loading module requirements

As you can see, there is a problem with the survey module, some kind of conflict between "github.com/AlecAivazis/survey@v1.8.4" and "gopkg.in/AlecAivazis/survey.v1"

Is there any workaround? I can't get to start using Sparta.

Thanks you!

alvaroloes commented 5 years ago

Ok, found the workaround. Put this in your application go.mod file:

replace github.com/AlecAivazis/survey => gopkg.in/AlecAivazis/survey.v1 v1.8.4
replace gopkg.in/AlecAivazis/survey.v1 => github.com/AlecAivazis/survey v1.8.4

Why two replace? because if not, we get this error: go: gopkg.in/AlecAivazis/survey.v1@v1.8.4 used for two different module paths (github.com/AlecAivazis/survey and gopkg.in/AlecAivazis/survey.v1) It seems that the project uses both paths.

I'll leave the issue open in case other people have the same problem. Please feel free to close it if you consider.

mweagle commented 5 years ago

Thanks @alvaroloes! I've been meaning to migrate to modules and will clean things up.

mweagle commented 5 years ago

Should be resolved with https://github.com/mweagle/Sparta/blob/master/CHANGES.md#v194. Closing - please reopen if you run into any issues.