From: Sergey Matveev Date: Thu, 5 Dec 2019 08:36:22 +0000 (+0300) Subject: Do not fail if no passwd file specified X-Git-Tag: v2.0.0~2 X-Git-Url: http://www.git.cypherpunks.ru/?p=gocheese.git;a=commitdiff_plain;h=c3f0f00242026194398c61105f5834fa3d630813 Do not fail if no passwd file specified --- diff --git a/passwd.go b/passwd.go index dbdac8c..f6760d2 100644 --- 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) }