Address JetBrains warnings

This commit is contained in:
2025-12-26 19:12:48 -05:00
parent b591e2ef5a
commit 2880ce2823
10 changed files with 34 additions and 44 deletions
+1 -2
View File
@@ -26,9 +26,8 @@ func GetOldEntryData(realPath string, field int) ([]string, error) {
// return the old entry data with all required lines present
if field > 0 {
return ensureSliceLength(decryptedEntry, field), nil
} else {
return decryptedEntry, nil
}
return decryptedEntry, nil
}
// ensureSliceLength is a utility function that ensures a slice is long enough to contain the specified index.
+1 -1
View File
@@ -17,7 +17,7 @@ import (
// rcwPassword and clientSpecificIniData can be left blank if not needed.
func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData map[string]any, rcwPassword []byte, preserveOldConfigDir bool, forceOfflineMode bool) error {
// handle clientSpecificIniData
newCfg := &cfg.CfgT{}
newCfg := &cfg.ConfigT{}
if clientSpecificIniData != nil {
newThirdPartyMap := make(map[string]any)
maps.Copy(newThirdPartyMap, clientSpecificIniData)
+1 -1
View File
@@ -28,7 +28,7 @@ func WriteEntry(realPath string, decSlice []string, passwordIsNew bool) error {
if decSlice != nil {
if passwordIsNew { // update age data when password changes
if decSlice[0] != "" { // if the password change was NOT a removal, update the age file
err = age.AgeEntry(global.GetVanityPath(realPath), time.Now().Unix())
err = age.Entry(global.GetVanityPath(realPath), time.Now().Unix())
if err != nil {
return errors.New("unable to update age data: " + err.Error())
}