Skip to content

v1.2.0

Compare
Choose a tag to compare
@paologaleotti paologaleotti released this 15 Apr 19:17
· 28 commits to master since this release

New for version v1.2.0

Better HTTP errors handling

  • New method for ApiError for better HTTP error handling: .With() to append a Go error to the API error message
  • .Msg() method for ApiError now appends a string to the API error message instaed of an error (use With to append errors)
  • Breaking: if you want to upgrade your app to this new version you need to migrate old error handling using the new methods.
  • You can find examples on how to use them in the official wiki

Init logic and handler refactoring

  • Router initialization with default middlewares (timeout, panic recovery, logger...) has been moved in api/init.go for better readability and consistency (instaed of pkg/httpcore/router)
  • HTTP Handlers has been moved in /handlers package to scale better when adding many handlers for different business logic domains

Minor improvements

  • Removed useless allocations when replying with an ApiError

Full Changelog: v1.1.0...v1.2.0