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

Identical blocks for then and else branches of conditional in typeinfo_test.go #8203

Closed
chavacava opened this issue Aug 4, 2024 · 0 comments
Assignees

Comments

@chavacava
Copy link

chavacava commented Aug 4, 2024

Both branches of this conditional are identical:

if ti.GetTypeIdentifier() == PointTypeIdentifier ||
ti.GetTypeIdentifier() == LineStringTypeIdentifier ||
ti.GetTypeIdentifier() == PolygonTypeIdentifier ||
ti.GetTypeIdentifier() == GeometryTypeIdentifier {
t.Run(ti.String(), func(t *testing.T) {
newTi, err := FromTypeParams(ti.GetTypeIdentifier(), ti.GetTypeParams())
require.NoError(t, err)
require.True(t, ti.Equals(newTi), "%v\n%v", ti.String(), newTi.String())
})
} else {
t.Run(ti.String(), func(t *testing.T) {
newTi, err := FromTypeParams(ti.GetTypeIdentifier(), ti.GetTypeParams())
require.NoError(t, err)
require.True(t, ti.Equals(newTi), "%v\n%v", ti.String(), newTi.String())
})
}

(found with revive @nicktobey)

@chavacava chavacava changed the title Identical blocks for the then and the else ranch of conditional in typeinfo_test.go Identical blocks for then and else branches of conditional in typeinfo_test.go Aug 5, 2024
@jycor jycor closed this as completed Aug 5, 2024
@jycor jycor self-assigned this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants