Skip to content

fix: invalid type for pool reset #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 9, 2025

Conversation

ldez
Copy link
Contributor

@ldez ldez commented Apr 9, 2025

The pool uses []goconst.Issue, but a *[]goconst.Issue is used to reset the buffer.

=== RUN   Test_IssuePool
--- FAIL: Test_IssuePool (0.00s)
panic: interface conversion: interface {} is *[]goconst.Issue, not []goconst.Issue [recovered]
	panic: interface conversion: interface {} is *[]goconst.Issue, not []goconst.Issue

goroutine 6 [running]:
testing.tRunner.func1.2({0x62ca60, 0xc0000a2a50})
	/home/ldez/.gvm/gos/go1.23.8/src/testing/testing.go:1632 +0x230
testing.tRunner.func1()
	/home/ldez/.gvm/gos/go1.23.8/src/testing/testing.go:1635 +0x35e
panic({0x62ca60?, 0xc0000a2a50?})
	/home/ldez/.gvm/gos/go1.23.8/src/runtime/panic.go:791 +0x132
github.com/jgautheron/goconst.GetIssueBuffer(...)
	/home/ldez/sources/golangci-lint-linters/goconst/api.go:33
github.com/jgautheron/goconst.Test_IssuePool(0xc0000a8820?)
	/home/ldez/sources/golangci-lint-linters/goconst/api_test.go:568 +0x48
testing.tRunner(0xc0000a8820, 0x67cbe8)
	/home/ldez/.gvm/gos/go1.23.8/src/testing/testing.go:1690 +0xf4
created by testing.(*T).Run in goroutine 1
	/home/ldez/.gvm/gos/go1.23.8/src/testing/testing.go:1743 +0x390

Related to b210ef1

@ldez
Copy link
Contributor Author

ldez commented Apr 9, 2025

Note: I think the IssuesPool can be removed.
I'm not sure about the real impact of the pool because it's not really used, and global variables are never friendly for something that can be used as a library.

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@af8760d). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #37   +/-   ##
=========================================
  Coverage          ?   66.01%           
=========================================
  Files             ?        4           
  Lines             ?     1030           
  Branches          ?        0           
=========================================
  Hits              ?      680           
  Misses            ?      316           
  Partials          ?       34           

☔ View full report in Codecov by Sentry.
📢 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.

@jgautheron jgautheron merged commit 93c54d3 into jgautheron:master Apr 9, 2025
9 of 11 checks passed
@ldez ldez deleted the fix/invalid-pool-reset branch April 9, 2025 13:21
@jgautheron
Copy link
Owner

@ldez I was running some tests there but will clean this up

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.

2 participants