gotests
gotests copied to clipboard
Skip creating args for case when only one TestParams
A lot of cases when func with one param func Sin(x int) int,
or writers func Write(w io.Writer, b []bytes)
and in generated tests for such func we see a lot of boilercode like
type args struct { x int }
In my pull request I try ti prevent creating unuseful args type for one param
Now generated tests looks like:
tests := []struct {
name string
arg string
}{
// TODO: Add test cases.
}
for _, tt := range tests {
Foo3(tt.arg)
}
instead of
type args struct {
s string
}
tests := []struct {
name string
args args
}{
// TODO: Add test cases.
}
for _, tt := range tests {
Foo3(tt.args.s)
}