diff options
Diffstat (limited to 'cmd/server/auth.go')
| -rw-r--r-- | cmd/server/auth.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/server/auth.go b/cmd/server/auth.go index 5e2316e..635b6e2 100644 --- a/cmd/server/auth.go +++ b/cmd/server/auth.go @@ -4,10 +4,11 @@ import ( "crypto/rand" "encoding/base64" "encoding/json" + "errors" "fmt" + "io/fs" "net/http" "os" - "strings" "riedstra.dev/mitch/go-website/users" ) @@ -59,8 +60,7 @@ func (a *App) ReadAuth(fn string) error { //nolint fh, err := os.Open(fn) if err != nil { - if strings.Contains(err.Error(), "no such file") || - strings.Contains(err.Error(), "system cannot find the file specified") { + if errors.Is(err, fs.ErrNotExist) { goto write } |
