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

all: ambiguous import caused by Azure/go-autorest #2798

Closed
johejo opened this issue May 25, 2020 · 1 comment · Fixed by #2799
Closed

all: ambiguous import caused by Azure/go-autorest #2798

johejo opened this issue May 25, 2020 · 1 comment · Fixed by #2799

Comments

@johejo
Copy link
Contributor

johejo commented May 25, 2020

Describe the bug

Using gocloud.dev and azure-service-bus-go at the same time resulted ambiguous import.

In order to fix this problem, it is necessary to upgrade azure-amqp-common-go to v3 and clean up the dependencies.
I am trying to fix it. #2799

To Reproduce

$ mkdir example && cd example/
$ go mod init example

main.go

package main

import (
	_ "github.com/Azure/azure-service-bus-go"
	_ "gocloud.dev"
)

go.mod

module example

go 1.14

require (
	github.com/Azure/azure-service-bus-go v0.10.1
	gocloud.dev v0.19.0
)
$ go mod tidy
example imports
        github.com/Azure/azure-service-bus-go imports
        github.com/Azure/go-autorest/autorest/azure: ambiguous import: found package github.com/Azure/go-autorest/autorest/azure in multiple modules:
        github.com/Azure/go-autorest v12.0.0+incompatible (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest@v12.0.0+incompatible/autorest/azure)
        github.com/Azure/go-autorest/autorest v0.9.3 (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest/autorest@v0.9.3/azure)
example imports
        github.com/Azure/azure-service-bus-go imports
        github.com/Azure/go-autorest/autorest/date: ambiguous import: found package github.com/Azure/go-autorest/autorest/date in multiple modules:
        github.com/Azure/go-autorest v12.0.0+incompatible (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest@v12.0.0+incompatible/autorest/date)
        github.com/Azure/go-autorest/autorest/date v0.2.0 (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest/autorest/date@v0.2.0)
example imports
        github.com/Azure/azure-service-bus-go imports
        github.com/Azure/go-autorest/autorest/to: ambiguous import: found package github.com/Azure/go-autorest/autorest/to in multiple modules:
        github.com/Azure/go-autorest v12.0.0+incompatible (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest@v12.0.0+incompatible/autorest/to)
        github.com/Azure/go-autorest/autorest/to v0.3.0 (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest/autorest/to@v0.3.0)
example imports
        github.com/Azure/azure-service-bus-go imports
        github.com/Azure/azure-amqp-common-go/v3/aad imports
        github.com/Azure/go-autorest/autorest/adal: ambiguous import: found package github.com/Azure/go-autorest/autorest/adal in multiple modules:
        github.com/Azure/go-autorest v12.0.0+incompatible (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest@v12.0.0+incompatible/autorest/adal)
        github.com/Azure/go-autorest/autorest/adal v0.8.1 (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest/autorest/adal@v0.8.1)
example imports
        github.com/Azure/azure-service-bus-go tested by
        github.com/Azure/azure-service-bus-go.test imports
        github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2015-08-01/servicebus imports
        github.com/Azure/go-autorest/autorest: ambiguous import: found package github.com/Azure/go-autorest/autorest in multiple modules:
        github.com/Azure/go-autorest v12.0.0+incompatible (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest@v12.0.0+incompatible/autorest)
        github.com/Azure/go-autorest/autorest v0.9.3 (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest/autorest@v0.9.3)
example imports
        github.com/Azure/azure-service-bus-go tested by
        github.com/Azure/azure-service-bus-go.test imports
        github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2015-08-01/servicebus imports
        github.com/Azure/go-autorest/autorest/validation: ambiguous import: found package github.com/Azure/go-autorest/autorest/validation in multiple modules:
        github.com/Azure/go-autorest v12.0.0+incompatible (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest@v12.0.0+incompatible/autorest/validation)
        github.com/Azure/go-autorest/autorest/validation v0.2.0 (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest/autorest/validation@v0.2.0)
example imports
        github.com/Azure/azure-service-bus-go tested by
        github.com/Azure/azure-service-bus-go.test imports
        github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2015-08-01/servicebus imports
        github.com/Azure/go-autorest/tracing: ambiguous import: found package github.com/Azure/go-autorest/tracing in multiple modules:
        github.com/Azure/go-autorest v12.0.0+incompatible (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest@v12.0.0+incompatible/tracing)
        github.com/Azure/go-autorest/tracing v0.5.0 (/home/heijo/go/pkg/mod/github.com/!azure/go-autorest/tracing@v0.5.0)

Expected behavior

go mod tidy expects to be succeed.

Version

gocloud.dev v0.19.0

go version go1.14.3 linux/amd64

Additional context

Using azure-service-bus-go downgraded to v0.9.1 will not cause any issues.

But we had to upgrade azure-service-bus-go to v0.10.1 to prevent panic.
Azure/azure-service-bus-go#158

@miquella
Copy link

I'm hoping that Azure/go-autorest#528 will provide resolution to this issue (once upgrade versions of the submodules are released).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants