Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于5.3节context的想法 #11

Open
marjune163 opened this issue Aug 25, 2020 · 0 comments
Open

关于5.3节context的想法 #11

marjune163 opened this issue Aug 25, 2020 · 0 comments

Comments

@marjune163
Copy link

之前读到context的定义,其中嵌入了上级类型,例如cancelCtx 中的Context

type cancelCtx struct {
	Context
        ......
}

我一直以为仅仅是重用了上一级的接口定义,与parent之间的联系由私有成员变量维护,而实际是直接在嵌入类型中存放了parent实例,之前一直没留意到,书中也没重点提及,感觉可以加强一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant