mirror of
https://github.com/aykhans/dodo.git
synced 2025-04-17 02:13:13 +00:00
- Moved readers to the config package - Added an option to read remote config files - Moved the validation package to the config package and removed the validator dependency - Moved the customerrors package to the config package - Replaced fatih/color with jedib0t/go-pretty/v6/text - Removed proxy check functionality - Added param, header, cookie, body, and proxy flags to the CLI - Allowed multiple values for the same key in params, headers, and cookies
25 lines
326 B
Go
25 lines
326 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/jedib0t/go-pretty/v6/text"
|
|
)
|
|
|
|
func PrintErr(err error) {
|
|
fmt.Fprintln(os.Stderr, text.FgRed.Sprint(err.Error()))
|
|
}
|
|
|
|
func PrintErrAndExit(err error) {
|
|
if err != nil {
|
|
PrintErr(err)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
func PrintAndExit(message string) {
|
|
fmt.Println(message)
|
|
os.Exit(0)
|
|
}
|