v1.0.4
- Build using Go 1.13.6.
- Add OS, architecture, and Go version to output when using the
--version
flag. - Improve errors by using types and implementing the error interface. Errors can now be checked using type assertions. See the tests for more usage examples.
if r, e = pushover.Message(pushover.MessageRequest{Token: os.Args[1], User: os.Args[2], Message: os.Args[3]}); e != nil {
if _, ok := e.(*pushover.ErrInvalidRequest); ok {
fmt.Println("request was invalid")
}
switch e.(type) {
case *pushover.ErrInvalidRequest:
fmt.Println("request was invalid")
case *pushover.ErrInvalidResponse:
fmt.Println("response was invalid")
default:
fmt.Println("other error")
}
}