1
0
mirror of https://github.com/mgechev/revive.git synced 2025-12-05 22:53:41 +02:00

fix(1323): false positive in get-return rule for HTTP Get handlers (#1325)

This commit is contained in:
chavacava
2025-04-27 13:06:29 +02:00
committed by GitHub
parent 7ba6ad4fcd
commit dbcfd66945
3 changed files with 47 additions and 25 deletions

View File

@@ -1,5 +1,7 @@
package fixtures
import "net/http"
func getfoo() {
}
@@ -27,3 +29,10 @@ func (t *t) GetSaz(a string, b int) { // MATCH /function 'GetSaz' seems to be a
func GetQux(a string, b int, c int, d string, e int64) { // MATCH /function 'GetQux' seems to be a getter but it does not return any result/
}
// non-regression test issue #1323
func (b *t) GetInfo(w http.ResponseWriter, r *http.Request) {}
func GetSomething(w http.ResponseWriter, r *http.Request, p int) {}
func GetSomethingElse(p int, w http.ResponseWriter, r *http.Request) {} // MATCH /function 'GetSomethingElse' seems to be a getter but it does not return any result/