GitLab_MergeDevel2Default/utils/utils.go
6543 e6c684b99c Refactor from script to cli tool (#9)
Reviewed-on: #9
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2021-05-22 11:14:51 +00:00

23 lines
412 B
Go

package utils
import (
"fmt"
"os"
)
// OptBool return ref of bool - dont ask it is go
func OptBool(val bool) *bool {
return &val
}
// OptString return ref of string - dont ask it is go
func OptString(val string) *string {
return &val
}
// Error format the error and exec the program with given status
func Error(status int, format string, a ...interface{}) {
fmt.Printf(format, a...)
os.Exit(status)
}