Skip to content

Commit 577ce1c

Browse files
committed
Fix linter
1 parent b574a79 commit 577ce1c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

secure_storage_manager.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func (ssm *fileBasedSecureStorageManager) ensurePermissions() error {
296296
}
297297

298298
if fileInfo.Mode().Perm() != 0o600&os.ModePerm {
299-
return fmt.Errorf("Incorrect permissions(%v, expected 600) for credential file.", fileInfo.Mode().Perm())
299+
return fmt.Errorf("incorrect permissions(%v, expected 600) for credential file", fileInfo.Mode().Perm())
300300

301301
}
302302

@@ -308,14 +308,14 @@ func (ssm *fileBasedSecureStorageManager) ensureOwner(filePath string) error {
308308
if err != nil {
309309
return err
310310
}
311-
dirOwnerUid, err := provideFileOwner(filePath)
311+
dirOwnerUID, err := provideFileOwner(filePath)
312312
if err != nil && !errors.Is(err, os.ErrNotExist) {
313313
return err
314314
}
315315
if errors.Is(err, os.ErrNotExist) {
316316
return nil
317317
}
318-
if strconv.Itoa(int(dirOwnerUid)) != currentUser.Uid {
318+
if strconv.Itoa(int(dirOwnerUID)) != currentUser.Uid {
319319
return errors.New("incorrect owner of " + ssm.credDirPath)
320320
}
321321
return nil

secure_storage_manager_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ func TestSnowflakeFileBasedSecureStorageManager(t *testing.T) {
139139
assertEqualE(t, ssm.getCredential(tokenSpec), "initialValue")
140140
err = os.Chmod(ssm.credFilePath(), 0644)
141141
assertNilF(t, err)
142-
defer os.Chmod(ssm.credFilePath(), 0600)
142+
defer func() {
143+
assertNilE(t, os.Chmod(ssm.credFilePath(), 0600))
144+
}()
143145
ssm.setCredential(tokenSpec, "newValue")
144146
assertEqualE(t, ssm.getCredential(tokenSpec), "")
145147
fileContent, err := os.ReadFile(ssm.credFilePath())

0 commit comments

Comments
 (0)