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

ambiguous import #172

Closed
ldez opened this issue Jan 20, 2022 · 2 comments
Closed

ambiguous import #172

ldez opened this issue Jan 20, 2022 · 2 comments

Comments

@ldez
Copy link

ldez commented Jan 20, 2022

when github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod is used as a transitive dependency an error occurs:

$ go mod tidy
go: downloading github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.333
go: downloading github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.333
github.com/traefik/traefik/v2/pkg/provider/acme imports
        github.com/go-acme/lego/v4/providers/dns imports
        github.com/go-acme/lego/v4/providers/dns/tencentcloud imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common: ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common in multiple modules:
        github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go@v3.0.83+incompatible/tencentcloud/common)
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.333 (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common@v1.0.333)
github.com/traefik/traefik/v2/pkg/provider/acme imports
        github.com/go-acme/lego/v4/providers/dns imports
        github.com/go-acme/lego/v4/providers/dns/tencentcloud imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile: ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile in multiple modules:
        github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go@v3.0.83+incompatible/tencentcloud/common/profile)
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.333 (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common@v1.0.333/profile)
github.com/traefik/traefik/v2/pkg/provider/acme imports
        github.com/go-acme/lego/v4/providers/dns imports
        github.com/go-acme/lego/v4/providers/dns/tencentcloud imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod/v20210323 imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors: ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors in multiple modules:
        github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go@v3.0.83+incompatible/tencentcloud/common/errors)
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.333 (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common@v1.0.333/errors)
github.com/traefik/traefik/v2/pkg/provider/acme imports
        github.com/go-acme/lego/v4/providers/dns imports
        github.com/go-acme/lego/v4/providers/dns/tencentcloud imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod/v20210323 imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http: ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http in multiple modules:
        github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go@v3.0.83+incompatible/tencentcloud/common/http)
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.333 (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common@v1.0.333/http)

The error occurs because the go.mod file of all your modules doesn't declare the dependencies.

This happens for many of your modules.

Related to #171

@sesky4
Copy link
Collaborator

sesky4 commented Feb 23, 2022

Thanks! fixed.

@sesky4 sesky4 closed this as completed Feb 23, 2022
@ldez
Copy link
Author

ldez commented Feb 23, 2022

The problem is still here:

$ go mod tidy
github.com/traefik/traefik/v2/pkg/provider/acme imports
        github.com/go-acme/lego/v4/providers/dns imports
        github.com/go-acme/lego/v4/providers/dns/tencentcloud imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common: ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common in multiple modules:
        github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go@v3.0.83+incompatible/tencentcloud/common)
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.353 (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common@v1.0.353)
github.com/traefik/traefik/v2/pkg/provider/acme imports
        github.com/go-acme/lego/v4/providers/dns imports
        github.com/go-acme/lego/v4/providers/dns/tencentcloud imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile: ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile in multiple modules:
        github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go@v3.0.83+incompatible/tencentcloud/common/profile)
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.353 (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common@v1.0.353/profile)
github.com/traefik/traefik/v2/pkg/provider/acme imports
        github.com/go-acme/lego/v4/providers/dns imports
        github.com/go-acme/lego/v4/providers/dns/tencentcloud imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod/v20210323 imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors: ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors in multiple modules:
        github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go@v3.0.83+incompatible/tencentcloud/common/errors)
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.353 (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common@v1.0.353/errors)
github.com/traefik/traefik/v2/pkg/provider/acme imports
        github.com/go-acme/lego/v4/providers/dns imports
        github.com/go-acme/lego/v4/providers/dns/tencentcloud imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod/v20210323 imports
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http: ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http in multiple modules:
        github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go@v3.0.83+incompatible/tencentcloud/common/http)
        github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.353 (/home/ldez/sources/go/pkg/mod/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common@v1.0.353/http)

I think the problem is related to the fact that github.com/tencentcloud/tencentcloud-sdk-go breaks the version continuity by moving from v3 to v1.

Maybe a solution can be to retract the old v3 modules:

go.mod
// ...

retract (
	v3.0.233+incompatible
	v3.0.232+incompatible
	v3.0.231+incompatible
	v3.0.230+incompatible
	v3.0.229+incompatible
	v3.0.228+incompatible
	v3.0.227+incompatible
	v3.0.226+incompatible
	v3.0.225+incompatible
	v3.0.224+incompatible
	v3.0.223+incompatible
	v3.0.222+incompatible
	v3.0.221+incompatible
	v3.0.220+incompatible
	v3.0.219+incompatible
	v3.0.218+incompatible
	v3.0.217+incompatible
	v3.0.216+incompatible
	v3.0.215+incompatible
	v3.0.214+incompatible
	v3.0.213+incompatible
	v3.0.212+incompatible
	v3.0.211+incompatible
	v3.0.210+incompatible
	v3.0.209+incompatible
	v3.0.208+incompatible
	v3.0.207+incompatible
	v3.0.206+incompatible
	v3.0.205+incompatible
	v3.0.204+incompatible
	v3.0.203+incompatible
	v3.0.202+incompatible
	v3.0.201+incompatible
	v3.0.200+incompatible
	v3.0.199+incompatible
	v3.0.198+incompatible
	v3.0.197+incompatible
	v3.0.196+incompatible
	v3.0.195+incompatible
	v3.0.194+incompatible
	v3.0.193+incompatible
	v3.0.192+incompatible
	v3.0.191+incompatible
	v3.0.190+incompatible
	v3.0.189+incompatible
	v3.0.188+incompatible
	v3.0.187+incompatible
	v3.0.186+incompatible
	v3.0.185+incompatible
	v3.0.184+incompatible
	v3.0.183+incompatible
	v3.0.182+incompatible
	v3.0.181+incompatible
	v3.0.180+incompatible
	v3.0.179+incompatible
	v3.0.178+incompatible
	v3.0.177+incompatible
	v3.0.176+incompatible
	v3.0.175+incompatible
	v3.0.174+incompatible
	v3.0.173+incompatible
	v3.0.172+incompatible
	v3.0.171+incompatible
	v3.0.170+incompatible
	v3.0.169+incompatible
	v3.0.168+incompatible
	v3.0.167+incompatible
	v3.0.166+incompatible
	v3.0.165+incompatible
	v3.0.164+incompatible
	v3.0.163+incompatible
	v3.0.162+incompatible
	v3.0.161+incompatible
	v3.0.160+incompatible
	v3.0.159+incompatible
	v3.0.158+incompatible
	v3.0.157+incompatible
	v3.0.156+incompatible
	v3.0.155+incompatible
	v3.0.154+incompatible
	v3.0.153+incompatible
	v3.0.152+incompatible
	v3.0.151+incompatible
	v3.0.150+incompatible
	v3.0.149+incompatible
	v3.0.148+incompatible
	v3.0.147+incompatible
	v3.0.146+incompatible
	v3.0.145+incompatible
	v3.0.144+incompatible
	v3.0.143+incompatible
	v3.0.142+incompatible
	v3.0.141+incompatible
	v3.0.140+incompatible
	v3.0.139+incompatible
	v3.0.138+incompatible
	v3.0.137+incompatible
	v3.0.136+incompatible
	v3.0.135+incompatible
	v3.0.134+incompatible
	v3.0.133+incompatible
	v3.0.132+incompatible
	v3.0.131+incompatible
	v3.0.130+incompatible
	v3.0.129+incompatible
	v3.0.128+incompatible
	v3.0.127+incompatible
	v3.0.126+incompatible
	v3.0.125+incompatible
	v3.0.124+incompatible
	v3.0.123+incompatible
	v3.0.121+incompatible
	v3.0.120+incompatible
	v3.0.119+incompatible
	v3.0.118+incompatible
	v3.0.117+incompatible
	v3.0.116+incompatible
	v3.0.115+incompatible
	v3.0.114+incompatible
	v3.0.113+incompatible
	v3.0.112+incompatible
	v3.0.111+incompatible
	v3.0.110+incompatible
	v3.0.109+incompatible
	v3.0.108+incompatible
	v3.0.107+incompatible
	v3.0.106+incompatible
	v3.0.105+incompatible
	v3.0.104+incompatible
	v3.0.103+incompatible
	v3.0.102+incompatible
	v3.0.101+incompatible
	v3.0.100+incompatible
	v3.0.99+incompatible
	v3.0.98+incompatible
	v3.0.97+incompatible
	v3.0.96+incompatible
	v3.0.95+incompatible
	v3.0.94+incompatible
	v3.0.93+incompatible
	v3.0.92+incompatible
	v3.0.91+incompatible
	v3.0.90+incompatible
	v3.0.89+incompatible
	v3.0.88+incompatible
	v3.0.87+incompatible
	v3.0.86+incompatible
	v3.0.85+incompatible
	v3.0.84+incompatible
	v3.0.83+incompatible
	v3.0.82+incompatible
	v3.0.81+incompatible
	v3.0.80+incompatible
	v3.0.79+incompatible
	v3.0.78+incompatible
	v3.0.77+incompatible
	v3.0.76+incompatible
	v3.0.75+incompatible
	v3.0.74+incompatible
	v3.0.73+incompatible
	v3.0.72+incompatible
	v3.0.71+incompatible
)

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

No branches or pull requests

2 participants