mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-27 20:36:29 -04:00
Address JetBrains warnings
This commit is contained in:
+1
-2
@@ -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
@@ -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
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user