Skip to content

test: remove embedded field types from struct literals in cmd/datastore tests - #879

Merged
mwbrooks merged 2 commits into
mainfrom
mwbrooks-modernize-datastore-tests-embedded
Nov 30, 2026
Merged

mwbrooks merged 2 commits into
mainfrom
mwbrooks-modernize-datastore-tests-embedded

Conversation

@mwbrooks

Copy link
Copy Markdown
Member

Changelog

N/A - internal cleanup with no user-facing changes.

Summary

This pull request removes the embedded field types from struct literals in the cmd/datastore tests for maintainers, from the Go modernize analyzer. Same behaviour, in the form current Go recommends. It follows #862, and #878 upgraded the linter so it can read this form.

  • cmd/datastore/count_test.go: 2 types.SlackYaml literals set Datastores directly instead of wrapping it in AppManifest: types.AppManifest{...}
  • cmd/datastore/datastore_test.go: 1 types.SlackYaml literal does the same for DisplayInformation and Datastores

Testing

  1. Run the modernize command and confirm cmd/datastore no longer reports "embedded field type can be removed from struct literal":
    go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest -test ./cmd/datastore/
  2. Run go build ./... && go test ./...

Requirements

@mwbrooks mwbrooks added this to the Next Release milestone Nov 30, 2026
@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels Nov 30, 2026
@mwbrooks mwbrooks self-assigned this Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.35%. Comparing base (92822a8) to head (fbde825).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #879   +/-   ##
=======================================
  Coverage   81.35%   81.35%           
=======================================
  Files         247      247           
  Lines       18881    18881           
=======================================
  Hits        15360    15360           
  Misses       3521     3521           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mwbrooks
mwbrooks marked this pull request as ready for review November 30, 2026 21:22
@mwbrooks
mwbrooks requested a review from a team as a code owner November 30, 2026 21:22

@WilliamBergamin WilliamBergamin 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.

💯 Thanks @mwbrooks! These are exactly the three spots modernize flags in cmd/datastore, and it runs clean on this branch with the tests still passing.
Nothing to add, looks good 🚀

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🧹 @mwbrooks LGTM! Straight cleanup, and dropping the AppManifest: wrapper in those three SlackYaml literals reads cleaner with the same fields set.

@mwbrooks

Copy link
Copy Markdown
Member Author

Thanks @zimeg and @WilliamBergamin for the quick reviews! 🙇

@mwbrooks
mwbrooks merged commit 1829e0a into main Nov 30, 2026
14 checks passed
@mwbrooks
mwbrooks deleted the mwbrooks-modernize-datastore-tests-embedded branch November 30, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants