Making http.Handler a little easier
- Introduced JSONResponder type in handler.go, combining JSON body parsing with ResponseHelper handling. - Implemented ServeHTTP for JSONResponder to automatically decode JSON requests and return structured responses. - Added comprehensive unit tests for JSONResponder in handler_test.go, covering successful responses, invalid JSON, empty bodies, and error propagation. - Ensured all new tests adhere to existing project conventions and pass linting checks. |
||
|---|---|---|
| .gitignore | ||
| .golangci.yaml | ||
| go.mod | ||
| go.sum | ||
| handler.go | ||
| handler_test.go | ||
| helper.go | ||
| helper_test.go | ||
| response.go | ||
| response_test.go | ||
| Taskfile.yml | ||