Skip to content

Commit 3dd576d

Browse files
committed
fix lint
1 parent da71755 commit 3dd576d

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.21
44

55
require (
66
github.com/Yamashou/gqlgenc v0.14.0
7-
github.com/golangci/golangci-lint v1.55.2
7+
github.com/golangci/golangci-lint v1.55.1
88
github.com/hashicorp/terraform-plugin-docs v0.16.0
99
github.com/hashicorp/terraform-plugin-framework v1.4.2
1010
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6
428428
github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ=
429429
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g=
430430
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM=
431-
github.com/golangci/golangci-lint v1.55.2 h1:yllEIsSJ7MtlDBwDJ9IMBkyEUz2fYE0b5B8IUgO1oP8=
432-
github.com/golangci/golangci-lint v1.55.2/go.mod h1:H60CZ0fuqoTwlTvnbyjhpZPWp7KmsjwV2yupIMiMXbM=
431+
github.com/golangci/golangci-lint v1.55.1 h1:DL2j9Eeapg1N3WEkKnQFX5L40SYtjZZJjGVdyEgNrDc=
432+
github.com/golangci/golangci-lint v1.55.1/go.mod h1:z00biPRqjo5MISKV1+RWgONf2KvrPDmfqxHpHKB6bI4=
433433
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA=
434434
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg=
435435
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA=

internal/datasource/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (d *clusterDataSource) Read(ctx context.Context, req datasource.ReadRequest
202202
}
203203

204204
if cluster == nil {
205-
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to read cluster, see warnings for more information"))
205+
resp.Diagnostics.AddError("Client Error", "Unable to read cluster, see warnings for more information")
206206
return
207207
}
208208

internal/datasource/git_repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (r *GitRepositoryDataSource) Read(ctx context.Context, req datasource.ReadR
8383
}
8484

8585
if response == nil || response.GitRepository == nil {
86-
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to find GitRepository"))
86+
resp.Diagnostics.AddError("Client Error", "Unable to find GitRepository")
8787
return
8888
}
8989

internal/datasource/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (p *providerDataSource) Read(ctx context.Context, req datasource.ReadReques
113113
return
114114
}
115115
if result == nil && result.ClusterProvider == nil {
116-
resp.Diagnostics.AddError("Not Found", fmt.Sprintf("Unable to find provider"))
116+
resp.Diagnostics.AddError("Not Found", "Unable to find provider")
117117
return
118118
}
119119

internal/defaults/env.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package defaults
22

33
import (
44
"context"
5-
"fmt"
65
"os"
76

87
"github.com/hashicorp/terraform-plugin-framework/resource/schema/defaults"
@@ -31,11 +30,11 @@ type envDefaultValue[T defaultable] struct {
3130
}
3231

3332
func (d envDefaultValue[_]) Description(_ context.Context) string {
34-
return fmt.Sprintf("If value is not configured, defaults to a representation of the provided env variable")
33+
return "If value is not configured, defaults to a representation of the provided env variable"
3534
}
3635

3736
func (d envDefaultValue[_]) MarkdownDescription(_ context.Context) string {
38-
return fmt.Sprintf("If value is not configured, defaults to a representation of the provided env variable")
37+
return "If value is not configured, defaults to a representation of the provided env variable"
3938
}
4039

4140
func (d envDefaultValue[T]) DefaultString(_ context.Context, _ defaults.StringRequest, resp *defaults.StringResponse) {
@@ -44,7 +43,8 @@ func (d envDefaultValue[T]) DefaultString(_ context.Context, _ defaults.StringRe
4443
value = v
4544
}
4645

47-
resp.PlanValue = types.StringValue(value.(string))
46+
stringValue, _ := value.(string)
47+
resp.PlanValue = types.StringValue(stringValue)
4848
}
4949

5050
func (d envDefaultValue[T]) DefaultBool(_ context.Context, _ defaults.BoolRequest, resp *defaults.BoolResponse) {
@@ -53,5 +53,6 @@ func (d envDefaultValue[T]) DefaultBool(_ context.Context, _ defaults.BoolReques
5353
value = v == "true"
5454
}
5555

56-
resp.PlanValue = types.BoolValue(value.(bool))
56+
boolValue, _ := value.(bool)
57+
resp.PlanValue = types.BoolValue(boolValue)
5758
}

internal/resource/cluster/cluster.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ func NewClusterResource() resource.Resource {
3232

3333
// ClusterResource defines the cluster resource implementation.
3434
type clusterResource struct {
35-
client *client.Client
36-
consoleUrl string
37-
operatorHandler *OperatorHandler
35+
client *client.Client
36+
consoleUrl string
3837
}
3938

4039
func (r *clusterResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
@@ -308,7 +307,7 @@ func (r *clusterResource) Create(ctx context.Context, req resource.CreateRequest
308307

309308
if common.IsCloud(data.Cloud.ValueString(), common.CloudBYOK) {
310309
if result.CreateCluster.DeployToken == nil {
311-
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to fetch cluster deploy token"))
310+
resp.Diagnostics.AddError("Client Error", "Unable to fetch cluster deploy token")
312311
return
313312
}
314313

@@ -342,7 +341,7 @@ func (r *clusterResource) Read(ctx context.Context, req resource.ReadRequest, re
342341
return
343342
}
344343
if result == nil || result.Cluster == nil {
345-
resp.Diagnostics.AddError("Not Found", fmt.Sprintf("Unable to find cluster, it looks like it was deleted manually"))
344+
resp.Diagnostics.AddError("Not Found", "Unable to find cluster, it looks like it was deleted manually")
346345
return
347346
}
348347

internal/resource/git_repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (r *GitRepositoryResource) Read(ctx context.Context, req resource.ReadReque
167167
}
168168

169169
if response == nil || response.GitRepository == nil {
170-
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to find GitRepository"))
170+
resp.Diagnostics.AddError("Client Error", "Unable to find GitRepository")
171171
return
172172
}
173173

internal/resource/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func (r *providerResource) Read(ctx context.Context, req resource.ReadRequest, r
213213
return
214214
}
215215
if result == nil || result.ClusterProvider == nil {
216-
resp.Diagnostics.AddError("Not Found", fmt.Sprintf("Unable to find provider, it looks like it was deleted manually"))
216+
resp.Diagnostics.AddError("Not Found", "Unable to find provider, it looks like it was deleted manually")
217217
return
218218
}
219219

internal/validator/also_requires_if.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (a alsoRequiresIfValidator) ValidateString(ctx context.Context, req validat
117117
resp.Diagnostics.Append(validateResp.Diagnostics...)
118118
}
119119

120-
// AlsoRequiresIf todo
120+
// AlsoRequiresIf todo.
121121
func AlsoRequiresIf(f RequiresIf, expressions ...path.Expression) validator.String {
122122
return &alsoRequiresIfValidator{
123123
PathExpressions: expressions,

0 commit comments

Comments
 (0)