@@ -25,9 +25,9 @@ func (f *KeyValueFileResolver) Resolve(value string) (string, error) {
25
25
26
26
file , err := os .Open (filePath )
27
27
if err != nil {
28
- return "" , fmt .Errorf ("Failed to open file '%s'. %v" , filePath , err )
28
+ return "" , fmt .Errorf ("failed to open file '%s'. %v" , filePath , err )
29
29
}
30
- defer file .Close ()
30
+ defer file .Close () // nolint:errcheck
31
31
32
32
if keyPath != "" {
33
33
return searchKeyInFile (file , keyPath )
@@ -36,7 +36,7 @@ func (f *KeyValueFileResolver) Resolve(value string) (string, error) {
36
36
// No key specified, read the whole file
37
37
data , err := io .ReadAll (file )
38
38
if err != nil {
39
- return "" , fmt .Errorf ("Failed to read file '%s'. %v" , filePath , err )
39
+ return "" , fmt .Errorf ("failed to read file '%s'. %v" , filePath , err )
40
40
}
41
41
return strings .TrimSpace (string (data )), nil
42
42
}
@@ -51,5 +51,5 @@ func searchKeyInFile(file *os.File, key string) (string, error) {
51
51
return strings .TrimSpace (pair [1 ]), nil
52
52
}
53
53
}
54
- return "" , fmt .Errorf ("Key '%s' not found in file '%s'. " , key , file .Name ())
54
+ return "" , fmt .Errorf ("key '%s' not found in file '%s'" , key , file .Name ())
55
55
}
0 commit comments