all: remove redundant conversions and import names (#21903)

This commit is contained in:
Alex Prut
2020-11-25 21:00:23 +01:00
committed by GitHub
parent f59ed3565d
commit 810f9e057d
44 changed files with 66 additions and 67 deletions

View File

@ -27,8 +27,8 @@ import (
func TestFeedPanics(t *testing.T) {
{
var f Feed
f.Send(int(2))
want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(int(0))}
f.Send(2)
want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(0)}
if err := checkPanic(want, func() { f.Send(uint64(2)) }); err != nil {
t.Error(err)
}
@ -37,14 +37,14 @@ func TestFeedPanics(t *testing.T) {
var f Feed
ch := make(chan int)
f.Subscribe(ch)
want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(int(0))}
want := feedTypeError{op: "Send", got: reflect.TypeOf(uint64(0)), want: reflect.TypeOf(0)}
if err := checkPanic(want, func() { f.Send(uint64(2)) }); err != nil {
t.Error(err)
}
}
{
var f Feed
f.Send(int(2))
f.Send(2)
want := feedTypeError{op: "Subscribe", got: reflect.TypeOf(make(chan uint64)), want: reflect.TypeOf(make(chan<- int))}
if err := checkPanic(want, func() { f.Subscribe(make(chan uint64)) }); err != nil {
t.Error(err)
@ -58,7 +58,7 @@ func TestFeedPanics(t *testing.T) {
}
{
var f Feed
if err := checkPanic(errBadChannel, func() { f.Subscribe(int(0)) }); err != nil {
if err := checkPanic(errBadChannel, func() { f.Subscribe(0) }); err != nil {
t.Error(err)
}
}