diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-04-11 15:49:46 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-04-11 15:49:46 -0400 |
| commit | 6d9e7ca21637a46e643c88ff8c74e884ae908ceb (patch) | |
| tree | a8f88e05d9a128350cea362cd90a55e78b18fd1f /util | |
| parent | 711fa555be918c95d045b52daa973921b4a015d1 (diff) | |
| download | hose-6d9e7ca21637a46e643c88ff8c74e884ae908ceb.zip | |
create util package
Diffstat (limited to 'util')
| -rw-r--r-- | util/util.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/util/util.go b/util/util.go new file mode 100644 index 0000000..0365331 --- /dev/null +++ b/util/util.go @@ -0,0 +1,16 @@ +package util + +import ( + "fmt" + "os" +) + +func Eprintf(format string, a ...any) { + Logf(format, a...) + os.Exit(1) +} + +func Logf(format string, a ...any) { + msg := fmt.Sprintf(format, a...) + fmt.Fprintf(os.Stderr, "%s\n", msg) +} |