Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kimdre committed Aug 9, 2024
1 parent 1ace010 commit c14ee0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/config/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func (cfg *AppConfig) setSOPSconfig() error {
if err != nil {
return fmt.Errorf("failed to read base64-encoded SOPS key: %v", err)
}

cfg.SOPSKey = string(keyData)
}

Expand All @@ -88,7 +89,9 @@ func (cfg *AppConfig) setSOPSconfig() error {
if err != nil {
return fmt.Errorf("failed to read SOPS key file: %v", err)
}

cfg.SOPSKey = string(keyData)
}

return nil
}
3 changes: 3 additions & 0 deletions internal/encryption/encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ func TestIsEncrypted(t *testing.T) {
for _, tt := range tests {
t.Run(tt.file, func(t *testing.T) {
filePath := filepath.Join("testdata", tt.file)

encrypted, err := IsEncrypted(filePath)
if err != nil && !errors.Is(err, tt.expectedError) {
t.Errorf("expected error %v, got %v", tt.expectedError, err)
}

if encrypted != tt.expected {
t.Errorf("expected %v, got %v", tt.expected, encrypted)
}
Expand All @@ -52,6 +54,7 @@ func TestDecryptFile(t *testing.T) {
for _, tt := range tests {
t.Run(tt.file, func(t *testing.T) {
filePath := filepath.Join("testdata", tt.file)

decryptedData, err := DecryptFile(filePath)
if err != nil && !errors.Is(err, tt.expectedError) {
t.Errorf("expected error %v, got %v", tt.expectedError, err)
Expand Down

0 comments on commit c14ee0a

Please sign in to comment.