]> Cypherpunks.ru repositories - gocheese.git/commitdiff
Do not fail if no passwd file specified
authorSergey Matveev <stargrave@stargrave.org>
Thu, 5 Dec 2019 08:36:22 +0000 (11:36 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 5 Dec 2019 08:36:22 +0000 (11:36 +0300)
passwd.go

index dbdac8c178065bb20fb77495548da27554661d3b..f6760d2910091bdcbefc301d2d85f29ae471512e 100644 (file)
--- a/passwd.go
+++ b/passwd.go
@@ -22,6 +22,7 @@ import (
        "errors"
        "io/ioutil"
        "log"
+       "os"
        "strings"
 )
 
@@ -52,6 +53,9 @@ func strToAuther(verifier string) (string, Auther, error) {
 
 func refreshPasswd() {
        passwd, err := ioutil.ReadFile(*passwdPath)
+       if os.IsNotExist(err) {
+               return
+       }
        if err != nil {
                log.Fatal(err)
        }