Skip to content

v1.0.4

Compare
Choose a tag to compare
@arcanericky arcanericky released this 15 Jan 00:37
v1.0.4
1c4189b
  • 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")
  }
}