From bd17d328851db1d422bbc0067558bff1c1e142f9 Mon Sep 17 00:00:00 2001 From: rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Tue, 22 Mar 2022 21:43:40 +0800 Subject: [PATCH] Fix the golang lint error: Variable 'session' collides with imported package name Signed-off-by: rick <1450685+LinuxSuRen@users.noreply.github.com> --- pkg/restic/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/restic/config.go b/pkg/restic/config.go index 4cde8336a..1600f39fa 100644 --- a/pkg/restic/config.go +++ b/pkg/restic/config.go @@ -113,14 +113,14 @@ func GetRepoIdentifier(location *velerov1api.BackupStorageLocation, name string) func getBucketRegion(bucket string) (string, error) { var region string - session, err := session.NewSession() + sess, err := session.NewSession() if err != nil { return "", errors.WithStack(err) } for _, partition := range endpoints.DefaultPartitions() { for regionHint := range partition.Regions() { - region, _ = s3manager.GetBucketRegion(context.Background(), session, bucket, regionHint) + region, _ = s3manager.GetBucketRegion(context.Background(), sess, bucket, regionHint) // we only need to try a single region hint per partition, so break after the first break