forcetypeassert
forcetypeassert copied to clipboard
Analyzer: fourcetypeassert finds type assertions which did forcely
It's not often, if ever, you need to do: ```go objAny := obj.(any) ``` But when you do, forcetypeassert wants you to check it.
[errcheck has `-asserts`](https://github.com/kisielk/errcheck#use) ([`check-type-assertions: true` in golangci-lint](https://golangci-lint.run/usage/linters/#errcheck)) which appears to offer the same functionality as forcetypeassert. Are you aware of any pros/cons/differences between them?
Consider the following code: ```golang type M struct{} func (M) F() (bool, bool) { return true, true } func Test(x any) bool { _, ok := x.(M).F() return ok }...