Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
fix docs for AssignableToTypeOf (#452)
Browse files Browse the repository at this point in the history
To make the example work we need to include the element to be casted.

Fixes #453.
  • Loading branch information
ethervoid authored Jul 10, 2020
1 parent d9ac678 commit 44e6f1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gomock/matchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 44e6f1e

Please sign in to comment.