1
0
mirror of https://github.com/mgechev/revive.git synced 2025-02-03 13:11:25 +02:00
revive/testdata/unchecked-type-assertion-accept-ignored.go

13 lines
316 B
Go
Raw Normal View History

package fixtures
var foo any = "foo"
func handleIgnoredIsOKByConfig() {
// No lint here bacuse `acceptIgnoredAssertionResult` is set to `true`
r, _ := foo.(int)
}
func handleSkippedStillFails() {
r := foo.(int) // MATCH /type cast result is unchecked in foo.(int) - type assertion will panic if not matched/
}