azure-event-hubs-go
                                
                                 azure-event-hubs-go copied to clipboard
                                
                                    azure-event-hubs-go copied to clipboard
                            
                            
                            
                        Examples not usable in Go-module because of AutoRest
Expected Behavior
creating a simple Go-Module should work like this, right?
mkdir testProject
cd testProject
go mod init someModule
touch main.go
# Copy contents of "Receive with EPH"-Example from README into main.go
go build
Actual Behavior
Build fails because of ambigous autorest-versions (0.3.0 and 12.0.0)
ambiguous import: found github.com/Azure/go-autorest/autorest in multiple modules:
	github.com/Azure/go-autorest v12.0.0+incompatible (/home/rare/go/pkg/mod/github.com/!azure/[email protected]+incompatible/autorest)
	github.com/Azure/go-autorest/autorest v0.3.0 (/home/rare/go/pkg/mod/github.com/!azure/go-autorest/[email protected])
Environment
- OS: Fedora 29
- Go version: 1.12.6
hmm... I wonder if a go mod tidy before go build would fix everything up.
@devigned Nope it doesn't, it's caused by using a previous non go.mod version of autorest, see here:
- https://github.com/Azure/go-autorest/issues/414
- https://github.com/kubernetes/client-go/issues/628
The only way to fix this as a user of the library right now is adding a replace directive which is really not a good solution. Could you please update the dependencies of your library? Thanks!
I experienced the same issue while developing a service using this lib. @elsesiy, I've basically done the exact same thing using the replace directive. It's nasty but at least it works.
The same change that was made in https://github.com/Azure/azure-amqp-common-go/pull/39 (namely, swapping out the base go-autorest package with its individual subpackages) should do the trick in the go.mod here too. Happy to post a PR to do this if needed.
I took a stab at this but it looks like the underlying Event Hubs package pulled from the azure-sdk-for-go project also pulls in the same go-autorest dependency chain, so it doesn't look like this can be done until https://github.com/Azure/azure-sdk-for-go/issues/2993 is resolved