Skip to content
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

fix: false positives on structs #235

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

letmein
Copy link
Contributor

@letmein letmein commented Dec 19, 2024

Ignore structs which are not being used as test tables.

For example, here "1" and "2" are reported as test examples:

func TestStruct(t *testing.T) {
	type item struct {
		id   string
		name string
	}
	items := []item{
		{"1", "one"},
		{"2", "two"},
	}

	for _, i := range items {
		if i.id == "" {
			t.Fail()
		}
	}
}
Before Screenshot 2024-12-19 at 12 39 56
After Screenshot 2024-12-19 at 12 42 39

@letmein letmein marked this pull request as draft December 19, 2024 10:10
@letmein letmein force-pushed the fix/table-tests branch 2 times, most recently from 0fa5421 to 6ace413 Compare December 19, 2024 10:18
@letmein letmein changed the title Fix false positives on structs fix: false positives on structs Dec 19, 2024
@letmein letmein marked this pull request as ready for review December 19, 2024 10:30
@fredrikaverpil
Copy link
Owner

Hey @letmein and many thanks for this fix! ⭐

@fredrikaverpil fredrikaverpil merged commit 1de0bef into fredrikaverpil:main Dec 19, 2024
10 checks passed
This was referenced Dec 19, 2024
@letmein letmein deleted the fix/table-tests branch December 20, 2024 06:41
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