summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/common.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/common.go b/common/common.go
new file mode 100644
index 0000000..00ac8e6
--- /dev/null
+++ b/common/common.go
@@ -0,0 +1,14 @@
+package common
+
+import (
+ "os"
+ "fmt"
+)
+
+func Perror(function string, err error) error {
+ return fmt.Errorf("%s(): %w", function, err)
+}
+
+func Error(format string, a ... any) (int, error) {
+ return fmt.Fprintf(os.Stderr, format, a)
+}