Skip to content

Commit 290c93a

Browse files
committed
fix: go lint errors
1 parent 70976aa commit 290c93a

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

pkg/bundler/config/config_test.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ import (
2323
// testValueTrue is used as a consistent value string for test assertions.
2424
const testValueTrue = "true"
2525

26+
// testValueModified is used as a consistent value string for test assertions.
27+
const testValueModified = "modified"
28+
29+
// testValueAdded is used as a consistent value string for test assertions.
30+
const testValueAdded = "added"
31+
2632
func TestConfigImmutability(t *testing.T) {
2733
cfg := NewConfig()
2834

@@ -168,8 +174,8 @@ func TestValueOverridesImmutability(t *testing.T) {
168174

169175
// Get and modify returned map
170176
got := cfg.ValueOverrides()
171-
got["gpuoperator"]["key"] = "modified"
172-
got["gpuoperator"]["new"] = "added"
177+
got["gpuoperator"]["key"] = testValueModified
178+
got["gpuoperator"]["new"] = testValueAdded
173179

174180
// Verify original config unchanged
175181
fresh := cfg.ValueOverrides()
@@ -233,8 +239,8 @@ func TestNodeSelectorOptions(t *testing.T) {
233239
cfg := NewConfig(WithSystemNodeSelector(selectors))
234240

235241
got := cfg.SystemNodeSelector()
236-
got["key"] = "modified"
237-
got["new"] = "added"
242+
got["key"] = testValueModified
243+
got["new"] = testValueAdded
238244

239245
fresh := cfg.SystemNodeSelector()
240246
if fresh["key"] != "value" {
@@ -651,8 +657,8 @@ func TestWorkloadSelectorOptions(t *testing.T) {
651657
cfg := NewConfig(WithWorkloadSelector(selector))
652658

653659
got := cfg.WorkloadSelector()
654-
got["workload-type"] = "modified"
655-
got["new"] = "added"
660+
got["workload-type"] = testValueModified
661+
got["new"] = testValueAdded
656662

657663
fresh := cfg.WorkloadSelector()
658664
if fresh["workload-type"] != "training" {

pkg/bundler/validations/registry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func RunValidations(ctx context.Context, componentName string, validations []rec
115115
}
116116
for _, err := range checkErrors {
117117
if validation.Message != "" {
118-
errors = append(errors, fmt.Errorf("%v. %s", err, validation.Message))
118+
errors = append(errors, fmt.Errorf("%w. %s", err, validation.Message))
119119
} else {
120120
errors = append(errors, err)
121121
}
@@ -132,7 +132,7 @@ func RunValidations(ctx context.Context, componentName string, validations []rec
132132
// Even if severity is warning, checkErrors should still be errors
133133
for _, err := range checkErrors {
134134
if validation.Message != "" {
135-
errors = append(errors, fmt.Errorf("%v. %s", err, validation.Message))
135+
errors = append(errors, fmt.Errorf("%w. %s", err, validation.Message))
136136
} else {
137137
errors = append(errors, err)
138138
}

0 commit comments

Comments
 (0)