Skip to content

fix: linter in echo-sql and book-inventory app#201

Merged
khareyash05 merged 1 commit intokeploy:mainfrom
SaketV8:fix-linter-in-sample-app
Feb 12, 2026
Merged

fix: linter in echo-sql and book-inventory app#201
khareyash05 merged 1 commit intokeploy:mainfrom
SaketV8:fix-linter-in-sample-app

Conversation

@SaketV8
Copy link
Contributor

@SaketV8 SaketV8 commented Feb 10, 2026

🚀 Fix linter issues in Go example apps

This PR Fixes #3758

This PR fixes linter errors in the echo-sql and book-store inventory applications.

Signed-off-by: Saket Maurya <mauryapriyadarshi2004@gmail.com>
Copilot AI review requested due to automatic review settings February 10, 2026 13:34
@SaketV8 SaketV8 requested a review from khareyash05 as a code owner February 10, 2026 13:34
Copy link
Contributor

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

Fixes golangci-lint/errcheck findings in the Go example apps by properly handling errors returned from deferred/cleanup calls (logger sync and SQL rows close), aligning with the repo’s enabled errcheck linter.

Changes:

  • Handle and log Logger.Sync() errors before exiting on DB connection failure in echo-sql.
  • Wrap rows.Close() in a deferred function that checks/logs the close error in book-store-inventory.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
echo-sql/main.go Checks Logger.Sync() error before Logger.Fatal to satisfy errcheck and improve shutdown behavior.
book-store-inventory/pkg/repositories/book_repository.go Checks rows.Close() error in a deferred closure to prevent resource leak warnings and satisfy errcheck.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@khareyash05 khareyash05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@khareyash05 khareyash05 merged commit bf6da30 into keploy:main Feb 12, 2026
24 of 25 checks passed
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.

[bug]: fix linter in echo-sql and book-store inventory go apps

2 participants