~welt/murse

ref: cfb166c0599325f5d0c175f8686ab1f0dfa75bd1 murse/util.go -rw-r--r-- 352 bytes
cfb166c0welt Update Makefile for new packaging. 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
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
}