From e31878bd7dcfdafe20f8db2acb3bb5a85530ee27 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Fri, 19 Jan 2024 21:40:39 -0500 Subject: [PATCH] Use better method of error type detection --- src/UNIXglobals.go | 2 +- src/entryList.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UNIXglobals.go b/src/UNIXglobals.go index 60cc48a..397e0a6 100644 --- a/src/UNIXglobals.go +++ b/src/UNIXglobals.go @@ -3,7 +3,7 @@ package main // EntryRoot path to libmutton entry directory TODO to be moved to libmutton -var EntryRoot = home + "/.local/share/libmutton" +var EntryRoot = home + "/.local/share/fake" // exported constants TODO to be moved to libmutton const ( diff --git a/src/entryList.go b/src/entryList.go index 2dd90fe..dd79787 100644 --- a/src/entryList.go +++ b/src/entryList.go @@ -58,7 +58,7 @@ func EntryListGen() { // check for errors encountered while walking directory if err != nil { // create EntryRoot if the error is the result of it not existing on the system - if err.Error() == "lstat "+EntryRoot+": no such file or directory" { + if os.IsNotExist(err) { _ = os.Mkdir(EntryRoot, 0700) dirList = append(dirList, "") } else {