enabled and fixed the errcheck linter rule

This commit is contained in:
Sergey Kanzhelev
2025-09-10 21:45:46 +00:00
parent 2fc1699725
commit 0ce333bbc5
27 changed files with 315 additions and 106 deletions
@@ -103,7 +103,9 @@ func TestNewPluginRun(t *testing.T) {
utMeta := v
t.Run(desp, func(t *testing.T) {
conf := cpmtypes.CustomPluginConfig{}
(&conf).ApplyConfiguration()
if err := (&conf).ApplyConfiguration(); err != nil {
t.Errorf("Failed to apply configuration: %v", err)
}
p := Plugin{config: conf}
gotExitStatus, gotOutput := p.run(utMeta.Rule)
// cut at position max_output_length if expected output is longer than max_output_length bytes
+3 -1
View File
@@ -219,7 +219,9 @@ func TestCustomPluginConfigApplyConfiguration(t *testing.T) {
}
for desp, utMeta := range utMetas {
(&utMeta.Orig).ApplyConfiguration()
if err := (&utMeta.Orig).ApplyConfiguration(); err != nil {
t.Errorf("Error in apply configuration for %q: %v", desp, err)
}
if !reflect.DeepEqual(utMeta.Orig, utMeta.Wanted) {
t.Errorf("Error in apply configuration for %q", desp)
t.Errorf("Wanted: %+v. \nGot: %+v", utMeta.Wanted, utMeta.Orig)