Skip to content

fix!(server): cast off deprecated API#297

Merged
shino merged 3 commits intomasterfrom
copilot/fix-echo-deprecated-api-usage
Feb 3, 2026
Merged

fix!(server): cast off deprecated API#297
shino merged 3 commits intomasterfrom
copilot/fix-echo-deprecated-api-usage

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Fix echo's deprecated API usage

This PR fixes the deprecated middleware.LoggerWithConfig API usage by replacing it with middleware.RequestLoggerWithConfig.

Changes:

  • Replace deprecated middleware.LoggerWithConfig with middleware.RequestLoggerWithConfig in server/server.go
  • Add newRequestLoggerConfig helper function to configure the new logger with JSON output format
  • Add required imports (encoding/json, io, strconv, time)
  • Test the changes - all tests pass
  • Run linter and fix any issues - no new linting issues
  • Fix pre-existing golangci-lint prealloc error in fetcher/exploitdb.go
  • Run code review - no issues found
  • Run security checks - no vulnerabilities found

Implementation Details:

  • Replaced middleware.LoggerWithConfig(middleware.LoggerConfig{Output: ...}) with middleware.RequestLoggerWithConfig(newRequestLoggerConfig(...))
  • Added newRequestLoggerConfig function that returns a properly configured middleware.RequestLoggerConfig with JSON logging format
  • Maintains same log output format as before with JSON structure
  • Fixed pre-existing prealloc lint issue by calculating total size before slice allocation (commit 123f86b)
  • Follows the exact pattern from the reference PR: fix!(server): cast off deprecated API go-cpe-dictionary#265

Security Summary:

No security vulnerabilities were discovered or introduced by these changes.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix echo's deprecated API usage</issue_title>
<issue_description>- CI error to be fixed: https://github.com/vulsio/go-exploitdb/actions/runs/20422302160/job/58676236713?pr=294

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: shino <10225+shino@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix echo's deprecated API usage fix!(server): cast off deprecated API Feb 3, 2026
Copilot AI requested a review from shino February 3, 2026 05:50
@shino
Copy link
Contributor

shino commented Feb 3, 2026

Co-authored-by: shino <10225+shino@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 3, 2026

@copilot Fix CI error https://github.com/vulsio/go-exploitdb/actions/runs/21618750013/job/62304869322?pr=297

Fixed the CI error. The issue was a pre-existing golangci-lint prealloc warning in fetcher/exploitdb.go (line 587). Preallocated the exploits slice by calculating the total size before allocation. Commit: 123f86b

@shino shino marked this pull request as ready for review February 3, 2026 06:51
@shino shino merged commit 09cf3ad into master Feb 3, 2026
7 checks passed
@shino shino deleted the copilot/fix-echo-deprecated-api-usage branch February 3, 2026 07:33
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.

Fix echo's deprecated API usage

2 participants