Breaking change in celeris core
The HandlerFunc type has changed from func(*Context) to func(*Context) error in v1.0.0.
Documentation updates needed
All code examples must use the new signature:
Before:
s.GET("/hello", func(c *celeris.Context) {
c.String(200, "Hello, World!")
})
After:
s.GET("/hello", func(c *celeris.Context) error {
return c.String(200, "Hello, World!")
})
New features to document
- Error-returning handlers — handlers return
error, c.Next() returns error
HTTPError type — celeris.NewHTTPError(code, message) for structured errors
- Error handling in middleware —
err := c.Next() to intercept downstream errors
- Unhandled error safety net —
*HTTPError → writes Code+Message; bare error → 500
- XML serialization —
c.XML(code, v) response method
- Content-type-aware binding —
c.Bind(v) auto-detects JSON/XML from Content-Type
- Explicit binding —
c.BindJSON(), c.BindXML()
- Content negotiation —
c.Negotiate(), c.Respond() for auto-format selection
- Response capture —
c.CaptureResponse(), c.ResponseBody(), c.ResponseContentType()
- Route-level middleware —
s.GET("/path", handler).Use(middleware)
Note: ProtoBuf is NOT in core — available via goceleris/middlewares.
Reference
The core doc.go and README.md have already been updated with the new patterns.
Breaking change in celeris core
The
HandlerFunctype has changed fromfunc(*Context)tofunc(*Context) errorin v1.0.0.Documentation updates needed
All code examples must use the new signature:
Before:
After:
New features to document
error,c.Next()returnserrorHTTPErrortype —celeris.NewHTTPError(code, message)for structured errorserr := c.Next()to intercept downstream errors*HTTPError→ writes Code+Message; bareerror→ 500c.XML(code, v)response methodc.Bind(v)auto-detects JSON/XML from Content-Typec.BindJSON(),c.BindXML()c.Negotiate(),c.Respond()for auto-format selectionc.CaptureResponse(),c.ResponseBody(),c.ResponseContentType()s.GET("/path", handler).Use(middleware)Note: ProtoBuf is NOT in core — available via
goceleris/middlewares.Reference
The core
doc.goandREADME.mdhave already been updated with the new patterns.