1
0
mirror of https://github.com/directorz/mailfull-go.git synced 2025-12-18 10:07:03 +00:00

cosmetic changes

This commit is contained in:
teru
2016-08-18 19:22:54 +09:00
parent 1329747f54
commit bd6228197a
3 changed files with 16 additions and 16 deletions

View File

@@ -81,9 +81,9 @@ func (c *UserCheckPwCommand) Run(args []string) int {
} }
if len(args) != 2 { if len(args) != 2 {
input, err1 := c.UI.AskSecret(fmt.Sprintf("Enter password for %s:", address)) input, err := c.UI.AskSecret(fmt.Sprintf("Enter password for %s:", address))
if err1 != nil { if err != nil {
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err1) fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
return 1 return 1
} }

View File

@@ -81,14 +81,14 @@ func (c *UserPasswdCommand) Run(args []string) int {
} }
if len(args) != 2 { if len(args) != 2 {
input1, err1 := c.UI.AskSecret(fmt.Sprintf("Enter new password for %s:", address)) input1, err := c.UI.AskSecret(fmt.Sprintf("Enter new password for %s:", address))
if err1 != nil { if err != nil {
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err1) fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
return 1 return 1
} }
input2, err2 := c.UI.AskSecret("Retype new password:") input2, err := c.UI.AskSecret("Retype new password:")
if err2 != nil { if err != nil {
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err2) fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
return 1 return 1
} }
if input1 != input2 { if input1 != input2 {
@@ -100,9 +100,9 @@ func (c *UserPasswdCommand) Run(args []string) int {
hashedPassword := mailfull.NeverMatchHashedPassword hashedPassword := mailfull.NeverMatchHashedPassword
if rawPassword != "" { if rawPassword != "" {
str, errHash := ssha.Generate(rawPassword, 4) str, err := ssha.Generate(rawPassword, 4)
if errHash != nil { if err != nil {
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", errHash) fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
return 1 return 1
} }
hashedPassword = str hashedPassword = str

View File

@@ -126,10 +126,10 @@ func OpenRepository(basePath string) (*Repository, error) {
for { for {
configDirPath := filepath.Join(rootPath, DirNameConfig) configDirPath := filepath.Join(rootPath, DirNameConfig)
fi, errStat := os.Stat(configDirPath) fi, err := os.Stat(configDirPath)
if errStat != nil { if err != nil {
if errStat.(*os.PathError).Err != syscall.ENOENT { if err.(*os.PathError).Err != syscall.ENOENT {
return nil, errStat return nil, err
} }
} else { } else {
if fi.IsDir() { if fi.IsDir() {