Skip to content

Commit

Permalink
fixup! Config: Add -edit and encryption upgrade to cmd/config
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Dec 7, 2024
1 parent 8181ec3 commit 57dab41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ func decryptFile(in string, key []byte) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("unable to decrypt config data. Error: %w", err)
}
if json, err := jsonparser.Set(outData, []byte("-1"), "encryptConfig"); err == nil {
// err probably means it didn't decrypt, but we don't tell the user that for security
if json, err := jsonparser.Set(outData, []byte("-1"), "encryptConfig"); err != nil {
return nil, fmt.Errorf("unable to decrypt config data. Error: %w", err)
} else {

Check failure on line 124 in cmd/config/config.go

View workflow job for this annotation

GitHub Actions / lint

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
outData = json
}
return outData, nil
Expand Down

0 comments on commit 57dab41

Please sign in to comment.