fix: fix more lintings
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / CI (pull_request) Failing after 11m17s
CI Workflow / Code coverage report (pull_request) Has been skipped
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 23m54s

This commit is contained in:
Marcel_Henselin 2026-02-13 13:22:09 +01:00
parent 944b872db7
commit 20593da30b
12 changed files with 42 additions and 42 deletions

View file

@ -77,13 +77,13 @@ linters:
linters:
- gochecknoinits
paths:
- third_party$
- builtin$
- examples$
- third_party/
- builtin/
- examples/
- tools/copy.go
- tools/main.go
- pkg_gen$
- cmd$
- pkg_gen/
- cmd/
formatters:
enable:
- gofmt
@ -95,8 +95,8 @@ formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- pkg_gen$
- cmd$
- third_party/
- builtin/
- examples/
- pkg_gen/
- cmd/

View file

@ -88,7 +88,7 @@ func CleanupTemporaryHome(tempHomePath string, t *testing.T) {
}
func ucFirst(s string) string {
if len(s) == 0 {
if s == "" {
return ""
}
return strings.ToUpper(s[:1]) + s[1:]

View file

@ -390,7 +390,7 @@ func (r *databaseResource) Update(
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (databaseId)")
return
}
databaseId := int32(databaseId64)
databaseId := int32(databaseId64) // nolint:gosec // check is performed above
ctx = tflog.SetField(ctx, "project_id", projectId)
ctx = tflog.SetField(ctx, "instance_id", instanceId)
@ -516,7 +516,7 @@ func (r *databaseResource) Delete(
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (databaseId)")
return
}
databaseId := int32(databaseId64)
databaseId := int32(databaseId64) // nolint:gosec // check is performed above
ctx = tflog.SetField(ctx, "project_id", projectId)
ctx = tflog.SetField(ctx, "instance_id", instanceId)
ctx = tflog.SetField(ctx, "region", region)

View file

@ -108,7 +108,7 @@ func (r *userDataSource) Read(
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (userId)")
return
}
userId := int32(userId64)
userId := int32(userId64) // nolint:gosec // check is performed above
region := r.providerData.GetRegionWithOverride(model.Region)
ctx = tflog.SetField(ctx, "project_id", projectId)

View file

@ -406,7 +406,7 @@ func (r *userResource) Update(
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (userId)")
return
}
userId := int32(userId64)
userId := int32(userId64) // nolint:gosec // check is performed above
// Update existing instance
err = r.client.UpdateUserRequest(
@ -518,7 +518,7 @@ func (r *userResource) Delete(
core.LogAndAddError(ctx, &resp.Diagnostics, "Error in type conversion", "int value too large (userId)")
return
}
userId := int32(userId64)
userId := int32(userId64) // nolint:gosec // check is performed above
// Delete existing record set
err := r.client.DeleteUserRequest(ctx, arg.projectId, arg.region, arg.instanceId, userId).Execute()

View file

@ -191,7 +191,7 @@ func toUpdatePayload(
if m.Replicas.ValueInt64() > math.MaxUint32 {
return nil, fmt.Errorf("replicas value is too big for uint32")
}
replVal := sqlserverflex.Replicas(uint32(m.Replicas.ValueInt64()))
replVal := sqlserverflex.Replicas(uint32(m.Replicas.ValueInt64())) // nolint:gosec // check is performed above
var netAcl []string
diags := m.Network.Acl.ElementsAs(ctx, &netAcl, false)

View file

@ -263,7 +263,7 @@ func toUpdatePayload(
if m.Replicas.ValueInt64() > math.MaxUint32 {
return nil, fmt.Errorf("replicas value is too big for uint32")
}
replVal := sqlserverflexbeta.Replicas(uint32(m.Replicas.ValueInt64()))
replVal := sqlserverflexbeta.Replicas(uint32(m.Replicas.ValueInt64())) // nolint:gosec // check is performed above
var netAcl []string
diags := m.Network.Acl.ElementsAs(ctx, &netAcl, false)