Skip to content

Commit 6e9b579

Browse files
authored
Merge pull request cch123#20 from mcrwayfun/read-source-code
update parentCancelCtx desc, empty ctx also returns nil and false
2 parents 0d92da6 + 9f85a46 commit 6e9b579

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func propagateCancel(parent Context, child canceler) {
319319
}
320320
```
321321

322-
parentCancelCtx 只识别 context 包内的三种类型,如果用户自己的类实现了 context.Context 接口,或者把 ctx 包在了自己的类型内,那这里始终返回的是 nil,false。
322+
parentCancelCtx 只识别 context 包内的三种类型,如果用户自己的类实现了 context.Context 接口,或者把 ctx 包在了自己的类型内,或者是 emptyCtx,那这里始终返回的是 nil,false。
323323

324324
```go
325325
func parentCancelCtx(parent Context) (*cancelCtx, bool) {

0 commit comments

Comments
 (0)