diff options
Diffstat (limited to 'pkg/tool/tool.go')
| -rw-r--r-- | pkg/tool/tool.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/tool/tool.go b/pkg/tool/tool.go new file mode 100644 index 000000000..bb1f436cc --- /dev/null +++ b/pkg/tool/tool.go @@ -0,0 +1,19 @@ +// Copyright 2020 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +// Package tool contains various helper utilitites useful for implementation of command line tools. +package tool + +import ( + "fmt" + "os" +) + +func Failf(msg string, args ...interface{}) { + fmt.Fprintf(os.Stderr, msg+"\n", args...) + os.Exit(1) +} + +func Fail(err error) { + Failf("%v", err) +} |
