diff --git a/.github/workflows/golint.yaml b/.github/workflows/golint.yaml index c1d3db31308a..5ffbd815e9d8 100644 --- a/.github/workflows/golint.yaml +++ b/.github/workflows/golint.yaml @@ -26,5 +26,5 @@ jobs: go-version-file: ./.go-version - uses: golangci/golangci-lint-action@v3 with: - version: 'v1.50.1' + version: 'v1.51.1' args: -v diff --git a/GNUmakefile b/GNUmakefile index 3532cb1423a2..1f8b1955cd5c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -16,7 +16,7 @@ tools: go install github.com/katbyte/terrafmt@latest go install golang.org/x/tools/cmd/goimports@latest go install mvdan.cc/gofumpt@latest - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH || $$GOPATH)/bin v1.50.1 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH || $$GOPATH)/bin v1.51.1 build: fmtcheck generate go install diff --git a/internal/services/containers/container_registry_resource.go b/internal/services/containers/container_registry_resource.go index 9648f6ec8bf2..c5e638d11426 100644 --- a/internal/services/containers/container_registry_resource.go +++ b/internal/services/containers/container_registry_resource.go @@ -251,7 +251,7 @@ func resourceContainerRegistryCreate(d *pluginsdk.ResourceData, meta interface{} newGeoReplicationLocations = expandReplications(geoReplications) // geo replications have been specified if len(newGeoReplicationLocations) > 0 { - err = applyGeoReplicationLocations(ctx, d, meta, id.ResourceGroup, id.Name, oldGeoReplicationLocations, newGeoReplicationLocations) + err = applyGeoReplicationLocations(ctx, meta, id.ResourceGroup, id.Name, oldGeoReplicationLocations, newGeoReplicationLocations) if err != nil { return fmt.Errorf("applying geo replications for %s: %+v", id, err) } @@ -349,12 +349,12 @@ func resourceContainerRegistryUpdate(d *pluginsdk.ResourceData, meta interface{} } if hasGeoReplicationsChanges { - err := applyGeoReplicationLocations(ctx, d, meta, id.ResourceGroup, id.Name, expandReplications(oldReplications), expandReplications(newReplications)) + err := applyGeoReplicationLocations(ctx, meta, id.ResourceGroup, id.Name, expandReplications(oldReplications), expandReplications(newReplications)) if err != nil { return fmt.Errorf("applying geo replications for %s: %+v", id, err) } } else if hasGeoReplicationLocationsChanges { - err := applyGeoReplicationLocations(ctx, d, meta, id.ResourceGroup, id.Name, expandReplicationsFromLocations(oldGeoReplicationLocations), expandReplicationsFromLocations(newGeoReplicationLocations)) + err := applyGeoReplicationLocations(ctx, meta, id.ResourceGroup, id.Name, expandReplicationsFromLocations(oldGeoReplicationLocations), expandReplicationsFromLocations(newGeoReplicationLocations)) if err != nil { return fmt.Errorf("applying geo replications for %s: %+v", id, err) } @@ -405,10 +405,8 @@ func applyContainerRegistrySku(d *pluginsdk.ResourceData, meta interface{}, sku return nil } -func applyGeoReplicationLocations(ctx context.Context, d *pluginsdk.ResourceData, meta interface{}, resourceGroup string, name string, oldGeoReplications []containerregistry.Replication, newGeoReplications []containerregistry.Replication) error { +func applyGeoReplicationLocations(ctx context.Context, meta interface{}, resourceGroup string, name string, oldGeoReplications []containerregistry.Replication, newGeoReplications []containerregistry.Replication) error { replicationClient := meta.(*clients.Client).Containers.ReplicationsClient - ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) - defer cancel() log.Printf("[INFO] preparing to apply geo-replications for Container Registry.") oldReplications := map[string]containerregistry.Replication{} diff --git a/internal/services/mssql/helper/elasticpool.go b/internal/services/mssql/helper/elasticpool.go index 18f1b8b9ca95..7f2c03d1e3f6 100644 --- a/internal/services/mssql/helper/elasticpool.go +++ b/internal/services/mssql/helper/elasticpool.go @@ -339,9 +339,7 @@ func buildErrorString(stub string, m map[int]float64) string { } // copy the values of the map of keys into a slice of ints - for v := range p { - a = append(a, p[v]) - } + a = append(a, p...) // sort the slice to get them in order sort.Ints(a)