mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-01 22:57:21 -04:00
Use better method of error type detection
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
// EntryRoot path to libmutton entry directory TODO to be moved to libmutton
|
// 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
|
// exported constants TODO to be moved to libmutton
|
||||||
const (
|
const (
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ func EntryListGen() {
|
|||||||
// check for errors encountered while walking directory
|
// check for errors encountered while walking directory
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// create EntryRoot if the error is the result of it not existing on the system
|
// 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)
|
_ = os.Mkdir(EntryRoot, 0700)
|
||||||
dirList = append(dirList, "")
|
dirList = append(dirList, "")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user