-
Notifications
You must be signed in to change notification settings - Fork 5
Get rid of github.com/go-chi/render use #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the dependency on github.com/go-chi/render by replacing its usage with a custom JSON response writer. It also updates the golangci configuration to adjust the enabled linters.
- Removed import and usage of github.com/go-chi/render
- Added a new writeJSON function to handle JSON responses
- Updated .golangci.yml to enable and reorder several linters
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server.go | Removed render.JSON usage; added a new writeJSON helper |
| .golangci.yml | Adjusted linter configuration settings and ordering |
Files not reviewed (1)
- go.mod: Language not supported
2b08aec to
fc08866
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the dependency on github.com/go-chi/render and replaces it with a custom JSON writer function while also updating the linting configuration.
- Removed the import and usage of github.com/go-chi/render
- Introduced a new writeJSON method to handle JSON responses
- Updated .golangci.yml to adjust the linter list and settings
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| server.go | Replaced render.JSON with a custom writeJSON function |
| .golangci.yml | Adjusted linter settings and enabled additional linters |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
server.go:215
- Since the HTTP headers are already written before encoding the response, consider encoding to a buffer first. This way, you can confirm the JSON encoding succeeds before sending the headers to avoid potential duplicate write issues.
if err := encoder.Encode(v); err != nil {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request removes the dependency on github.com/go-chi/render by replacing its JSON response functionality with a custom writeJSON helper and updates the linter configuration.
- Removed import and usage of github.com/go-chi/render
- Added writeJSON helper method for JSON responses
- Updated the .golangci.yml file to adjust enabled linters
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server.go | Replaced render.JSON with a custom writeJSON function |
| .golangci.yml | Modified linter configuration to adjust enabled checks |
Files not reviewed (1)
- go.mod: Language not supported
fc08866 to
08b5d54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the dependency on github.com/go-chi/render from the server while updating the JSON response function and adjusts the golangci-lint configuration.
- Removed the go-chi/render import and replaced its usage with rest.RenderJSON in server.go.
- Updated .golangci.yml to remove custom golint settings and add/adjust enabled linters.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| server.go | Removed go-chi/render import and replaced render.JSON with rest.RenderJSON. |
| .golangci.yml | Adjusted lint configuration by removing custom golint settings and refining the enabled linters list. |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (2)
server.go:205
- [nitpick] Please verify that rest.RenderJSON handles response headers and error scenarios equivalently to render.JSON to ensure consistent API behavior.
rest.RenderJSON(w, fn(req.ID, params))
.golangci.yml:31
- [nitpick] Removing the custom min-confidence setting for golint might alter linting behavior; please confirm that the default configuration aligns with the project's coding guidelines.
- golint
08b5d54 to
1749e12
Compare
1749e12 to
90a4a50
Compare
No description provided.