brpaz
3/15/2019 - 7:57 PM

Multiple error types handling

#golang

if err != nil {
        switch err.(type) {
        case *ErrZeroDivision:
            fmt.Println(err.Error())
        default:
            fmt.Println("What the h* just happened?")
        }
    }