Documentation ¶
Overview ¶
Example ¶
package main import ( "errors" "fmt" "github.com/suzuki-shunsuke/go-error-with-exit-code/ecerror" ) func createUser() error { err := errors.New("user name is required") return ecerror.Wrap(err, 100) } func main() { err := createUser() fmt.Printf("The exit code is %d\n", ecerror.GetExitCode(err)) }
Output: The exit code is 100
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExitCode ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.