[go-server] Fix: error handling and linting (#18550)

* Update error.go and fix lint

* Regen

* Fix incorrect change

* Fix handler issue

* Regenerate
This commit is contained in:
Ween Jiann
2024-05-08 00:06:45 +08:00
committed by GitHub
parent 06499605e1
commit 8f6a2860bf
50 changed files with 219 additions and 194 deletions

View File

@@ -35,7 +35,7 @@ func WithBothAPIErrorHandler(h ErrorHandler) BothAPIOption {
}
// NewBothAPIController creates a default api controller
func NewBothAPIController(s BothAPIServicer, opts ...BothAPIOption) Router {
func NewBothAPIController(s BothAPIServicer, opts ...BothAPIOption) *BothAPIController {
controller := &BothAPIController{
service: s,
errorHandler: DefaultErrorHandler,
@@ -89,5 +89,5 @@ func (c *BothAPIController) Both(w http.ResponseWriter, r *http.Request) {
return
}
// If no error, encode the body and the result code
EncodeJSONResponse(result.Body, &result.Code, result.Headers, w)
_ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w)
}