Skip to content

Conversation

@paskal
Copy link
Contributor

@paskal paskal commented Mar 31, 2025

No description provided.

@paskal paskal requested a review from umputun as a code owner March 31, 2025 18:58
@paskal paskal requested a review from Copilot March 31, 2025 18:58
Copy link

Copilot AI left a 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

@paskal paskal force-pushed the paskal/chi_render branch 2 times, most recently from 2b08aec to fc08866 Compare March 31, 2025 19:08
@paskal paskal requested a review from Copilot March 31, 2025 19:08
Copy link

Copilot AI left a 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 {

@paskal paskal requested a review from Copilot March 31, 2025 19:10
Copy link

Copilot AI left a 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

@paskal paskal marked this pull request as draft March 31, 2025 19:14
@paskal paskal marked this pull request as draft March 31, 2025 19:14
@paskal paskal force-pushed the paskal/chi_render branch from fc08866 to 08b5d54 Compare March 31, 2025 19:40
@paskal paskal requested a review from Copilot March 31, 2025 19:40
@paskal paskal marked this pull request as ready for review March 31, 2025 19:41
Copy link

Copilot AI left a 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

@paskal paskal force-pushed the paskal/chi_render branch from 08b5d54 to 1749e12 Compare March 31, 2025 19:44
@paskal paskal requested a review from umputun April 15, 2025 02:51
@paskal paskal force-pushed the paskal/chi_render branch from 1749e12 to 90a4a50 Compare April 15, 2025 03:02
@umputun umputun merged commit 1b265f7 into master Apr 15, 2025
4 checks passed
@paskal paskal deleted the paskal/chi_render branch April 15, 2025 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants