We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40fde69 commit d2842c5Copy full SHA for d2842c5
errorlint/testdata/src/issues/issue-50.go
@@ -0,0 +1,33 @@
1
+package issues
2
+
3
+// Regression test for: https://github.com/polyfloyd/go-errorlint/issues/50
4
5
+type AssertError struct {
6
+ reason string
7
+}
8
9
+func (e *AssertError) Error() string {
10
+ return e.reason
11
12
13
+func (e *AssertError) Is(target error) bool {
14
+ terr, ok := target.(*AssertError)
15
+ return ok && terr.reason == e.reason
16
17
18
+type SwitchError struct {
19
20
21
22
+func (e *SwitchError) Error() string {
23
24
25
26
+func (e *SwitchError) Is(target error) bool {
27
+ switch terr := target.(type) {
28
+ case *SwitchError:
29
+ return terr.reason == e.reason
30
+ default:
31
+ return false
32
+ }
33
0 commit comments