mirror of
https://github.com/directorz/mailfull-go.git
synced 2025-12-17 17:47:04 +00:00
cosmetic changes
This commit is contained in:
@@ -81,9 +81,9 @@ func (c *UserCheckPwCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
if len(args) != 2 {
|
||||
input, err1 := c.UI.AskSecret(fmt.Sprintf("Enter password for %s:", address))
|
||||
if err1 != nil {
|
||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err1)
|
||||
input, err := c.UI.AskSecret(fmt.Sprintf("Enter password for %s:", address))
|
||||
if err != nil {
|
||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
@@ -81,14 +81,14 @@ func (c *UserPasswdCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
if len(args) != 2 {
|
||||
input1, err1 := c.UI.AskSecret(fmt.Sprintf("Enter new password for %s:", address))
|
||||
if err1 != nil {
|
||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err1)
|
||||
input1, err := c.UI.AskSecret(fmt.Sprintf("Enter new password for %s:", address))
|
||||
if err != nil {
|
||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||
return 1
|
||||
}
|
||||
input2, err2 := c.UI.AskSecret("Retype new password:")
|
||||
if err2 != nil {
|
||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err2)
|
||||
input2, err := c.UI.AskSecret("Retype new password:")
|
||||
if err != nil {
|
||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||
return 1
|
||||
}
|
||||
if input1 != input2 {
|
||||
@@ -100,9 +100,9 @@ func (c *UserPasswdCommand) Run(args []string) int {
|
||||
|
||||
hashedPassword := mailfull.NeverMatchHashedPassword
|
||||
if rawPassword != "" {
|
||||
str, errHash := ssha.Generate(rawPassword, 4)
|
||||
if errHash != nil {
|
||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", errHash)
|
||||
str, err := ssha.Generate(rawPassword, 4)
|
||||
if err != nil {
|
||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||
return 1
|
||||
}
|
||||
hashedPassword = str
|
||||
|
||||
@@ -126,10 +126,10 @@ func OpenRepository(basePath string) (*Repository, error) {
|
||||
for {
|
||||
configDirPath := filepath.Join(rootPath, DirNameConfig)
|
||||
|
||||
fi, errStat := os.Stat(configDirPath)
|
||||
if errStat != nil {
|
||||
if errStat.(*os.PathError).Err != syscall.ENOENT {
|
||||
return nil, errStat
|
||||
fi, err := os.Stat(configDirPath)
|
||||
if err != nil {
|
||||
if err.(*os.PathError).Err != syscall.ENOENT {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
if fi.IsDir() {
|
||||
|
||||
Reference in New Issue
Block a user