Skip to content

Commit e809dc9

Browse files
committed
chore(go) run go fix ./...
1 parent 564a8ad commit e809dc9

File tree

167 files changed

+3074
-3220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+3074
-3220
lines changed

stackit/internal/conversion/conversion.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ func ToTerraformStringMap(ctx context.Context, m map[string]string) (basetypes.M
6363
}
6464

6565
// ToStringInterfaceMap converts a basetypes.MapValue of Strings to a map[string]interface{}.
66-
func ToStringInterfaceMap(ctx context.Context, m basetypes.MapValue) (map[string]interface{}, error) {
66+
func ToStringInterfaceMap(ctx context.Context, m basetypes.MapValue) (map[string]any, error) {
6767
labels := map[string]string{}
6868
diags := m.ElementsAs(ctx, &labels, false)
6969
if diags.HasError() {
7070
return nil, fmt.Errorf("converting from MapValue: %w", core.DiagsToError(diags))
7171
}
7272

73-
interfaceMap := make(map[string]interface{}, len(labels))
73+
interfaceMap := make(map[string]any, len(labels))
7474
for k, v := range labels {
7575
interfaceMap[k] = v
7676
}
@@ -177,7 +177,7 @@ func StringSetToPointer(set basetypes.SetValue) (*[]string, error) {
177177
// It takes a current map as it is in the terraform state and a desired map as it is in the user configuratiom
178178
// and builds a map which sets to null keys that should be removed, updates the values of existing keys and adds new keys
179179
// This method is needed because in partial updates, e.g. if the key is not provided it is ignored and not removed
180-
func ToJSONMapPartialUpdatePayload(ctx context.Context, current, desired types.Map) (map[string]interface{}, error) {
180+
func ToJSONMapPartialUpdatePayload(ctx context.Context, current, desired types.Map) (map[string]any, error) {
181181
currentMap, err := ToStringInterfaceMap(ctx, current)
182182
if err != nil {
183183
return nil, fmt.Errorf("converting to Go map: %w", err)
@@ -188,7 +188,7 @@ func ToJSONMapPartialUpdatePayload(ctx context.Context, current, desired types.M
188188
return nil, fmt.Errorf("converting to Go map: %w", err)
189189
}
190190

191-
mapPayload := map[string]interface{}{}
191+
mapPayload := map[string]any{}
192192
// Update and remove existing keys
193193
for k := range currentMap {
194194
if desiredValue, ok := desiredMap[k]; ok {

stackit/internal/conversion/conversion_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestFromTerraformStringMapToInterfaceMap(t *testing.T) {
2424
tests := []struct {
2525
name string
2626
args args
27-
want map[string]interface{}
27+
want map[string]any
2828
wantErr bool
2929
}{
3030
{
@@ -37,7 +37,7 @@ func TestFromTerraformStringMapToInterfaceMap(t *testing.T) {
3737
"key3": types.StringValue("value3"),
3838
}),
3939
},
40-
want: map[string]interface{}{
40+
want: map[string]any{
4141
"key": "value",
4242
"key2": "value2",
4343
"key3": "value3",
@@ -50,7 +50,7 @@ func TestFromTerraformStringMapToInterfaceMap(t *testing.T) {
5050
ctx: context.Background(),
5151
m: types.MapValueMust(types.StringType, map[string]attr.Value{}),
5252
},
53-
want: map[string]interface{}{},
53+
want: map[string]any{},
5454
wantErr: false,
5555
},
5656
{
@@ -59,7 +59,7 @@ func TestFromTerraformStringMapToInterfaceMap(t *testing.T) {
5959
ctx: context.Background(),
6060
m: types.MapNull(types.StringType),
6161
},
62-
want: map[string]interface{}{},
62+
want: map[string]any{},
6363
wantErr: false,
6464
},
6565
{
@@ -92,7 +92,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
9292
description string
9393
currentLabels types.Map
9494
desiredLabels types.Map
95-
expected map[string]interface{}
95+
expected map[string]any
9696
isValid bool
9797
}{
9898
{
@@ -103,7 +103,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
103103
types.MapValueMust(types.StringType, map[string]attr.Value{
104104
"key": types.StringValue("value"),
105105
}),
106-
map[string]interface{}{
106+
map[string]any{
107107
"key": "value",
108108
},
109109
true,
@@ -116,7 +116,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
116116
types.MapValueMust(types.StringType, map[string]attr.Value{
117117
"key": types.StringValue("updated_value"),
118118
}),
119-
map[string]interface{}{
119+
map[string]any{
120120
"key": "updated_value",
121121
},
122122
true,
@@ -130,7 +130,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
130130
types.MapValueMust(types.StringType, map[string]attr.Value{
131131
"key": types.StringValue("value"),
132132
}),
133-
map[string]interface{}{
133+
map[string]any{
134134
"key": "value",
135135
"key2": nil,
136136
},
@@ -145,7 +145,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
145145
"key": types.StringValue("value"),
146146
"key2": types.StringValue("value2"),
147147
}),
148-
map[string]interface{}{
148+
map[string]any{
149149
"key": "value",
150150
"key2": "value2",
151151
},
@@ -158,7 +158,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
158158
"key2": types.StringValue("value2"),
159159
}),
160160
types.MapValueMust(types.StringType, map[string]attr.Value{}),
161-
map[string]interface{}{
161+
map[string]any{
162162
"key": nil,
163163
"key2": nil,
164164
},
@@ -171,7 +171,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
171171
"key2": types.StringValue("value2"),
172172
}),
173173
types.MapNull(types.StringType),
174-
map[string]interface{}{
174+
map[string]any{
175175
"key": nil,
176176
"key2": nil,
177177
},
@@ -184,7 +184,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
184184
"key": types.StringValue("value"),
185185
"key2": types.StringValue("value2"),
186186
}),
187-
map[string]interface{}{
187+
map[string]any{
188188
"key": "value",
189189
"key2": "value2",
190190
},
@@ -197,7 +197,7 @@ func TestToJSONMapUpdatePayload(t *testing.T) {
197197
"key": types.StringValue("value"),
198198
"key2": types.StringValue("value2"),
199199
}),
200-
map[string]interface{}{
200+
map[string]any{
201201
"key": "value",
202202
"key2": "value2",
203203
},

stackit/internal/core/core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func LogResponse(ctx context.Context) context.Context {
157157
traceId := runtime.GetTraceId(ctx)
158158
ctx = tflog.SetField(ctx, "x-trace-id", traceId)
159159

160-
tflog.Info(ctx, "response data", map[string]interface{}{
160+
tflog.Info(ctx, "response data", map[string]any{
161161
"x-trace-id": traceId,
162162
})
163163
return ctx

stackit/internal/services/alb/applicationloadbalancer/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ func (r *applicationLoadBalancerResource) Create(ctx context.Context, req resour
11731173

11741174
ctx = core.LogResponse(ctx)
11751175

1176-
ctx = utils.SetAndLogStateFields(ctx, &resp.Diagnostics, &resp.State, map[string]interface{}{
1176+
ctx = utils.SetAndLogStateFields(ctx, &resp.Diagnostics, &resp.State, map[string]any{
11771177
"project_id": projectId,
11781178
"region": region,
11791179
"name": *createResp.Name,

0 commit comments

Comments
 (0)