golangci-lint/test/testdata/inamedparam.go
Matheus Macabu 4b188dbfd1
Add "inamedparam": checks for interface method with unnamed params (#3793)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2023-10-13 00:12:16 +02:00

30 lines
841 B
Go

//golangcitest:args -Einamedparam
package testdata
import "context"
type tStruct struct {
a int
}
type Doer interface {
Do() string
}
type NamedParam interface {
Void()
NoArgs() string
WithName(ctx context.Context, number int, toggle bool, tStruct *tStruct, doer Doer) (bool, error)
WithoutName(
context.Context, // want "interface method WithoutName must have named param for type context.Context"
int, // want "interface method WithoutName must have named param for type int"
bool, // want "interface method WithoutName must have named param for type bool"
tStruct, // want "interface method WithoutName must have named param for type tStruct"
Doer, // want "interface method WithoutName must have named param for type Doer"
struct{ b bool }, // want "interface method WithoutName must have all named params"
)
}