package util import ( "os" "syscall" ) //no such file or directory func IsNoSuchFileOrDirectory(err error) bool { if err == syscall.ENOENT { return true } pathErr, ok := err.(*os.PathError) return ok && pathErr.Err == syscall.ENOENT }