fix: fix the error output format

This commit is contained in:
luhaoling 2024-02-22 21:48:24 +08:00
parent 80c4b6ce7b
commit 0ae6336501

View File

@ -15,7 +15,6 @@
package genutil
import (
"errors"
"fmt"
"os"
"path/filepath"
@ -42,11 +41,8 @@ func OutDir(path string) (string, error) {
}
func ExitWithError(err error) {
if errors.Is(err, errors.New("SIGTERM EXIT")) {
os.Exit(-1)
}
progName := filepath.Base(os.Args[0])
fmt.Fprintf(os.Stderr, "\n\n%s exit -1: \n%+v\n\n", progName, err)
fmt.Fprintf(os.Stderr, "%s exit -1: %+v\n", progName, err)
os.Exit(-1)
}