From 44e6f1e62df7acd93517ed618553188d7cd9d8da Mon Sep 17 00:00:00 2001 From: Mario de Frutos Dieguez Date: Fri, 10 Jul 2020 15:58:37 +0200 Subject: [PATCH] fix docs for AssignableToTypeOf (#452) To make the example work we need to include the element to be casted. Fixes #453. --- gomock/matchers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gomock/matchers.go b/gomock/matchers.go index 7bfc07be..cf5566ef 100644 --- a/gomock/matchers.go +++ b/gomock/matchers.go @@ -245,7 +245,7 @@ func Not(x interface{}) Matcher { // AssignableToTypeOf(s).Matches(time.Second) // returns true // AssignableToTypeOf(s).Matches(99) // returns false // -// var ctx = reflect.TypeOf((*context.Context)).Elem() +// var ctx = reflect.TypeOf((*context.Context)(nil)).Elem() // AssignableToTypeOf(ctx).Matches(context.Background()) // returns true func AssignableToTypeOf(x interface{}) Matcher { if xt, ok := x.(reflect.Type); ok {