Skip to content

Commit 087820a

Browse files
committed
fix(lint): solve linter problems
1 parent f65e013 commit 087820a

File tree

4 files changed

+23
-64
lines changed

4 files changed

+23
-64
lines changed

flake.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
packages = [
4444
go_1_23
4545
govulncheck
46+
golangci-lint
47+
golangci-lint-langserver
4648
];
4749
};
4850

@@ -58,6 +60,7 @@
5860
mkShell {
5961
packages = [
6062
(terraform.withPlugins (tf: [ tf.sysdig ]))
63+
bashInteractive
6164
];
6265
};
6366

sysdig/common_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"os"
55
"strings"
66
"testing"
7-
8-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
97
)
108

119
const (
@@ -31,17 +29,3 @@ func preCheckAnyEnv(t *testing.T, envs ...string) func() {
3129
}
3230
}
3331
}
34-
35-
func sysdigOrIBMMonitorPreCheck(t *testing.T) func() {
36-
return func() {
37-
monitor := os.Getenv("SYSDIG_MONITOR_API_TOKEN")
38-
ibmMonitor := os.Getenv("SYSDIG_IBM_MONITOR_API_KEY")
39-
if monitor == "" && ibmMonitor == "" {
40-
t.Fatal("SYSDIG_MONITOR_API_TOKEN or SYSDIG_IBM_MONITOR_API_KEY must be set for acceptance tests")
41-
}
42-
}
43-
}
44-
45-
func randomText(len int) string {
46-
return acctest.RandStringFromCharSet(len, acctest.CharSetAlphaNum)
47-
}

sysdig/resource_sysdig_monitor_team_shared_test.go

Lines changed: 0 additions & 28 deletions
This file was deleted.

sysdig/resource_sysdig_secure_accept_vulnerability_risk.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -255,30 +255,30 @@ func resourceSysdigSecureVulnerabilityAcceptRiskRead(ctx context.Context, d *sch
255255
if err != nil {
256256
return diag.FromErr(err)
257257
}
258-
d.Set("reason", result.Reason)
259-
d.Set("description", result.Description)
258+
_ = d.Set("reason", result.Reason)
259+
_ = d.Set("description", result.Description)
260260
if result.ExpirationDate != "" {
261-
d.Set("expiration_date", result.ExpirationDate)
261+
_ = d.Set("expiration_date", result.ExpirationDate)
262262
}
263-
d.Set("stages", result.Stages)
263+
_ = d.Set("stages", result.Stages)
264264
switch result.EntityType {
265265
case v2.EntityTypeImageName:
266-
d.Set("image", result.EntityValue)
266+
_ = d.Set("image", result.EntityValue)
267267
case v2.EntityTypeImagePrefix:
268-
d.Set("image", result.EntityValue+"*")
268+
_ = d.Set("image", result.EntityValue+"*")
269269
case v2.EntityTypeImageSuffix:
270-
d.Set("image", "*"+result.EntityValue)
270+
_ = d.Set("image", "*"+result.EntityValue)
271271
case v2.EntityTypeImageNameContains:
272-
d.Set("image", "*"+result.EntityValue+"*")
272+
_ = d.Set("image", "*"+result.EntityValue+"*")
273273
case v2.EntityTypeVulnerability:
274-
d.Set("cve", result.EntityValue)
274+
_ = d.Set("cve", result.EntityValue)
275275
fillResourceDataFromContextSlice(d, result.Context)
276276
case v2.EntityTypeHostName:
277-
d.Set("hostname", result.EntityValue)
277+
_ = d.Set("hostname", result.EntityValue)
278278
case v2.EntityTypeHostNameContains:
279-
d.Set("hostname_contains", result.EntityValue)
279+
_ = d.Set("hostname_contains", result.EntityValue)
280280
case v2.EntityTypePolicyRule:
281-
d.Set("rule_id", result.EntityValue)
281+
_ = d.Set("rule_id", result.EntityValue)
282282
fillResourceDataFromContextSlice(d, result.Context)
283283
default:
284284
panic(fmt.Sprintf("unexpected v2.EntityType: %#v", result.EntityType))
@@ -295,21 +295,21 @@ func fillResourceDataFromContextSlice(d *schema.ResourceData, contextSlice []v2.
295295
func fillResourceDataFromContext(d *schema.ResourceData, context v2.AcceptVulnerabilityRiskContext) {
296296
switch context.ContextType {
297297
case v2.ContextTypeHostName:
298-
d.Set("hostname", context.ContextValue)
298+
_ = d.Set("hostname", context.ContextValue)
299299
case v2.ContextTypeHostNameContains:
300-
d.Set("hostname_contains", context.ContextValue)
300+
_ = d.Set("hostname_contains", context.ContextValue)
301301
case v2.ContextTypeImageName:
302-
d.Set("image", context.ContextValue)
302+
_ = d.Set("image", context.ContextValue)
303303
case v2.ContextTypeImageNameContains:
304-
d.Set("image", "*"+context.ContextValue+"*")
304+
_ = d.Set("image", "*"+context.ContextValue+"*")
305305
case v2.ContextTypeImagePrefix:
306-
d.Set("image", context.ContextValue+"*")
306+
_ = d.Set("image", context.ContextValue+"*")
307307
case v2.ContextTypeImageSuffix:
308-
d.Set("image", "*"+context.ContextValue)
308+
_ = d.Set("image", "*"+context.ContextValue)
309309
case v2.ContextTypePackageName:
310-
d.Set("package_name", context.ContextValue)
310+
_ = d.Set("package_name", context.ContextValue)
311311
case v2.ContextTypePackageVersion:
312-
d.Set("package_version", context.ContextValue)
312+
_ = d.Set("package_version", context.ContextValue)
313313
default:
314314
panic(fmt.Sprintf("unexpected v2.ContextType: %#v", context.ContextType))
315315
}

0 commit comments

Comments
 (0)