Skip to content

#401 Fixed all minor golangci-lint errors + integrated golangci-lint into CI/CD - #466

Merged
mikehquan19 merged 7 commits into
developfrom
ci-linter
Nov 26, 2026
Merged

mikehquan19 merged 7 commits into
developfrom
ci-linter

Conversation

@a-avad

@a-avad a-avad commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Issue #401
Ran golangci-lint run, exported errors into lint.txt (did not push lint.txt). Fixed each issue present in lint.txt. Added golangci-lint into Makefile. Did the same on build.bat

Testing

Ran make check, all tests passed.
Only tested on MAC. No testing has been done on Windows or Linux.

AI Disclosure

Claude was used only at the end to help bug fix an issue with storage.Client{} in storage_test.go giving a nil error which was due to empty credentials. (No code was generated)

Checklist

  • Create this PR
  • Perform final self-review

Fixed all the linting errors
17 errcheck
2 govet
4 staticcheck

Updated Makefile + build.bat with corresponding setup line and golangci-lint run ./...
added **/.DS_Store for mac
@a-avad
a-avad requested review from a team as code owners October 30, 2026 01:16
@Yogeb-tech

Copy link
Copy Markdown
Contributor

I will review this one

@Yogeb-tech Yogeb-tech left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just one minor change I would like

I do want to provide more context on the storage_test.go modifications. This member reached out to me about cryptic errors caused by storage_test.go. When we found out it was due to empty credentials I suggested replacing the storage.Client{} with a working fake client.

There are several reasons why I prefer this approach avad made.

  • The fakestorage implementation is better because it uses a fully functional in-memory server to test the entire upload flow, whereas the empty storage.Client{} can panic and never actually tests a successful upload.
  • The former implementation uses an empty recover() block that silently swallows failures, while the latter properly fails the test if an unexpected panic occurs to expose real bugs.
  • The fakestorage approach also allows us to confirm that when a file is under the limit, PostObject correctly creates a GCS writer, writes the bytes, and closes it without error, whereas the first version's "Upload within limit" test can pass even if PostObject completely fails to upload anything.
    • Currently this is not implemented in avad's approach, but we can make it a seperate beginner issue

Comment thread rest/controllers/storage_test.go Resolved
Yogeb-tech
Yogeb-tech previously approved these changes Nov 17, 2026
@mikehquan19
mikehquan19 merged commit 6a0de1a into develop Nov 26, 2026
2 checks passed
@mikehquan19
mikehquan19 deleted the ci-linter branch November 26, 2026 05:37
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