Skip to content

Commit

Permalink
linting: fixing bugs caught by golint-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Feb 10, 2023
1 parent 2da355d commit 4bf2b56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions internal/services/containers/container_registry_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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{}
Expand Down
3 changes: 2 additions & 1 deletion internal/services/mssql/helper/elasticpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ 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])
val := p[v]
a = append(a, val)
}

// sort the slice to get them in order
Expand Down

0 comments on commit 4bf2b56

Please sign in to comment.