Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ruleguard: improve FieldList and Field matching (#342)
Fixes #315
- Loading branch information
Showing
5 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package regression | ||
|
||
import ( | ||
"io" | ||
) | ||
|
||
type Issue315_Iface interface { | ||
Example() | ||
} | ||
|
||
func Issue315_Func() { | ||
} | ||
|
||
func Issue315_FuncErr() error { | ||
return nil | ||
} | ||
|
||
func Issue315_Func1() io.Reader { // want `\Qreturn concrete type instead of io.Reader` | ||
return nil | ||
} | ||
|
||
func Issue315_Func2() (io.Reader, error) { // want `\Qreturn concrete type instead of io.Reader` | ||
return nil, nil | ||
} | ||
|
||
func Issue315_Func3() (int, Issue315_Iface, error) { // want `\Qreturn concrete type instead of Issue315_Iface` | ||
return 0, nil, nil | ||
} | ||
|
||
type Issue315_Example struct{} | ||
|
||
func (example Issue315_Example) Func1(x int) (Issue315_Iface, error) { // want `\Qreturn concrete type instead of Issue315_Iface` | ||
return nil, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters