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

Go 断言 — WalkingSun #60

Open
WalkingSun opened this issue Jan 12, 2020 · 0 comments
Open

Go 断言 — WalkingSun #60

WalkingSun opened this issue Jan 12, 2020 · 0 comments

Comments

@WalkingSun
Copy link
Owner

https://walkingsun.github.io/WindBlog/2020/01/12/go-assertion/

断言golang中的所有程序都实现了interface{}的接口,这意味着,所有的类型如string,int,int64甚至是自定义的struct类型都就此拥有了interface{}的接口,这种做法和java中的Object类型比较类似。那么在一个数据通过func funcName(interface{})的方式传进来的时候,也就意味着这个参数被自动的转为interface{}的类型。

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

No branches or pull requests

1 participant