You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
After further review, it looks like what's going on is, Context.Background() is a *context.emptyCtx where as ctx is a *context.cancelCtx. So in fact, it should print false.
AssignableToTypeOf is a Matcher that matches if the parameter to the mock function is assignable to the type of the parameter to this function.
Context.Background is context.Context and context.cancelCtx is also context.Context.so AssignableToTypeOf(context.Background()) should match context.cancelCtx.
package main
import (
"context""fmt"
)
funcmain() {
ctx:=context.Background()
ctxWithCancel, cancel:=context.WithCancel(context.Background())
defercancel()
ctx=ctxWithCancel// no error herefmt.Println(ctx.Err())
}
The text was updated successfully, but these errors were encountered: