Skip to content

Commit a541dcd

Browse files
committed
make linter happy
1 parent e2398fc commit a541dcd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

file.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ func (f *KeyValueFileResolver) Resolve(value string) (string, error) {
2525

2626
file, err := os.Open(filePath)
2727
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)
2929
}
30-
defer file.Close()
30+
defer file.Close() // nolint:errcheck
3131

3232
if keyPath != "" {
3333
return searchKeyInFile(file, keyPath)
@@ -36,7 +36,7 @@ func (f *KeyValueFileResolver) Resolve(value string) (string, error) {
3636
// No key specified, read the whole file
3737
data, err := io.ReadAll(file)
3838
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)
4040
}
4141
return strings.TrimSpace(string(data)), nil
4242
}
@@ -51,5 +51,5 @@ func searchKeyInFile(file *os.File, key string) (string, error) {
5151
return strings.TrimSpace(pair[1]), nil
5252
}
5353
}
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())
5555
}

resolver_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestResolveVariable(t *testing.T) {
2222
t.Parallel()
2323

2424
envName := "RESOLVER_TEST_ENV_" + sanitizeEnvName(t.Name())
25-
os.Setenv(envName, "envValue")
25+
os.Setenv(envName, "envValue") // nolint:errcheck
2626

2727
val, err := ResolveVariable("env:" + envName)
2828
assert.NoError(t, err, "unexpected error resolving env variable")
@@ -39,7 +39,7 @@ func TestResolveVariable(t *testing.T) {
3939
assert.NoError(t, err, "failed to write test JSON file")
4040

4141
envName := "RESOLVER_TEST_JSON_" + sanitizeEnvName(t.Name())
42-
os.Setenv(envName, jsonPath)
42+
os.Setenv(envName, jsonPath) // nolint:errcheck
4343

4444
val, err := ResolveVariable("json:$" + envName + "//key")
4545
assert.NoError(t, err, "unexpected error resolving json key")

0 commit comments

Comments
 (0)