mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-04 16:12:47 +08:00
22 lines
285 B
Go
22 lines
285 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
const (
|
|
// ExitSuccess define
|
|
ExitSuccess = iota
|
|
// ExitError define
|
|
ExitError
|
|
// ExitBadArgs define
|
|
ExitBadArgs
|
|
)
|
|
|
|
// ExitWithError define
|
|
func ExitWithError(code int, err error) {
|
|
fmt.Fprintln(os.Stderr, "Error: ", err)
|
|
os.Exit(code)
|
|
}
|