~welt/murse

ref: e0a63434ea769ed8019286e88ec319f39e057d00 murse/util.go -rw-r--r-- 353 bytes
e0a63434welt Change update to minor version instead of patch. a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main

import (
	"fmt"
	"os"

	"github.com/bwmarrin/snowflake"
)

var sfnode, _ = snowflake.NewNode(0)

func errPrintln(a ...any) {
	fmt.Fprintln(os.Stderr, a...)
}

func isExists(dir string) (bool, error) {
	_, err := os.Stat(dir)
	if err != nil {
		if os.IsNotExist(err) {
			return false, nil
		}

		return false, err
	}

	return true, nil

}