aws / aws-sdk-go-v2

AWS SDK for the Go programming language.
https://aws.github.io/aws-sdk-go-v2/docs/
Apache License 2.0
2.62k stars 628 forks source link

go get -u pulling the preview release and causing issue with ambiguous imports #2224

Closed Venkat2382 closed 1 year ago

Venkat2382 commented 1 year ago

Describe the bug

When ever I do a go get -u to update the packages, I see that the preview release is getting pulled and giving issues with ambiguous imports. More over the preview release seems to be different than the current 1.20 version. How to avoid this when we do go get -u and what is the date that we have to move to new v2.0.0 version.

Expected Behavior

go get -u should pull only the latest stable version not the preview version.

Current Behavior

go get -u is pulling the preview release and causing issues with go imports.

Reproduction Steps

go get -u is pulling the preview release and causing issues with go imports.

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

1.20.0

Compiler and Version used

go version go1.20.7 darwin/amd64

Operating System and version

Mac OS

lucix-aws commented 1 year ago

We have no "preview" version of the Go v2 SDK nor should there be a tag for one with v2.0.0. We have no plans to implement a 2.x version of the SDK at this time.

Can you elaborate on the issue you're having with go get? Can you share the resulting content of go.mod / go.sum after running the command?

Venkat2382 commented 1 year ago

@lucix-aws the below is what I see

github.com/aws/aws-sdk-go-v2/service/s3: ambiguous import: found package github.com/aws/aws-sdk-go-v2/service/s3 in multiple modules: github.com/aws/aws-sdk-go-v2 v2.0.0-preview.4+incompatible (/usr/local/go/pkg/pkg/mod/github.com/aws/aws-sdk-go-v2@v2.0.0-preview.4+incompatible/service/s3) github.com/aws/aws-sdk-go-v2/service/s3 v1.36.0 (/usr/local/go/pkg/pkg/mod/github.com/aws/aws-sdk-go-v2/service/s3@v1.36.0)

not sure where this is github.com/aws/aws-sdk-go-v2 v2.0.0-preview.4+incompatible. when I do a go get -u this is the library it is pulling for aws-sdk-go-v2 as latest

Venkat2382 commented 1 year ago

The below is sample go.mod

go 1.20

require ( github.com/aws/aws-sdk-go-v2 v1.20.0 github.com/aws/aws-sdk-go-v2/config v1.18.27 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.71 github.com/aws/aws-sdk-go-v2/service/s3 v1.36.0 github.com/aws/aws-sdk-go-v2/service/sqs v1.23.2 github.com/cloudevents/sdk-go/v2 v2.14.0 github.com/go-redis/redis/v8 v8.11.5 github.com/go-redis/redismock/v8 v8.11.5 github.com/google/uuid v1.3.0 github.com/stretchr/testify v1.8.4 gitlab.centene.com/caas/DeliveryServices/mongo-service v0.0.7 gitlab.centene.com/caas/DeliveryServices/utils/config v1.1.4 gitlab.centene.com/caas/DeliveryServices/utils/eventbridge v1.0.4 gitlab.centene.com/caas/DeliveryServices/utils/http v1.0.3 gitlab.centene.com/caas/DeliveryServices/utils/logger v1.0.3 gitlab.centene.com/caas/DeliveryServices/utils/logging v1.0.5 gitlab.centene.com/caas/DeliveryServices/utils/models v1.2.5 gitlab.centene.com/caas/DeliveryServices/utils/prometheus v1.0.3 gitlab.centene.com/caas/DeliveryServices/utils/redisUtils v1.0.12 gitlab.centene.com/caas/DeliveryServices/utils/router v1.0.2 gitlab.centene.com/caas/DeliveryServices/utils/s3manager v1.0.11 gitlab.centene.com/caas/DeliveryServices/utils/sanitizers v1.0.2 gitlab.centene.com/caas/DeliveryServices/utils/sqsconsumer v1.0.14 )

require ( github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect github.com/alessio/shellescape v1.4.1 // indirect github.com/aws/aws-sdk-go v1.44.106 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.26 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.26 // indirect github.com/aws/aws-sdk-go-v2/service/eventbridge v1.19.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.29 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.3 // indirect github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.19.8 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 // indirect github.com/aws/smithy-go v1.14.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bytedance/sonic v1.10.0-rc2 // indirect github.com/cenkalti/backoff/v3 v3.0.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect github.com/cyberark/conjur-api-go v0.11.1 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/pprof v1.4.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/gin-gonic/gin v1.9.1 // indirect github.com/go-jose/go-jose/v3 v3.0.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/go-stack/stack v1.8.0 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.6.6 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/vault/api v1.9.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.13.6 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/leodido/go-urn v1.2.4 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml v1.9.4 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.11.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.31.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/rs/zerolog v1.28.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smarty/assertions v1.15.1 // indirect github.com/spf13/afero v1.6.0 // indirect github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.10.1 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.0.2 // indirect github.com/xdg-go/stringprep v1.0.2 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect github.com/zalando/go-keyring v0.2.3-0.20230503081219-17db2e5354bd // indirect github.com/zsais/go-gin-prometheus v0.1.0 // indirect gitlab.centene.com/caas/DeliveryServices/utils/constants v1.0.2 // indirect gitlab.centene.com/caas/DeliveryServices/utils/secrets v1.0.5 // indirect gitlab.centene.com/caas/fedlayer/fedlayermodels v1.9.1 // indirect go.mongodb.org/mongo-driver v1.7.3 // indirect go.uber.org/atomic v1.4.0 // indirect go.uber.org/multierr v1.1.0 // indirect go.uber.org/zap v1.10.0 // indirect golang.org/x/arch v0.4.0 // indirect golang.org/x/crypto v0.9.0 // indirect golang.org/x/net v0.10.0 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect )

The below is the go.sum [redacted due to length]

lucix-aws commented 1 year ago

The tag v2.0.0-preview.4+incompatible doesn't exist in this repository as of this writing, but it does exist in the history of pkg.go.dev. I can only assume one of the following:

Please verify all of the above and try again. Unfortunately there's not really anything actionable for us here otherwise. I receive the expected version v1.20.1 when I run go get -u github.com/aws/aws-sdk-go-v2.

github-actions[bot] commented 1 year ago

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.