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

接收器 (receiver) 与接口 这一节有问题 #30

Open
xuyang404 opened this issue Dec 22, 2020 · 5 comments
Open

接收器 (receiver) 与接口 这一节有问题 #30

xuyang404 opened this issue Dec 22, 2020 · 5 comments

Comments

@xuyang404
Copy link

sPtrs := map[int]*S{1: {"A"}} 确定编译器不会报错吗?

@xxjwxc
Copy link
Owner

xxjwxc commented Dec 22, 2020

image

亲手实验。没有问题

@xuyang404
Copy link
Author

image

亲手实验。没有问题

为什么不用指定结构体类型?比如这样:
sPtrs := map[int]*S{1: &S{"A"}}

@xxjwxc
Copy link
Owner

xxjwxc commented Dec 22, 2020

省略写法。他的重点不在构造,在于后边的调用。

@xuyang404
Copy link
Author

省略写法。他的重点不在构造,在于后边的调用。

好的,谢谢解答

@discipline-yyl
Copy link
Contributor

省略写法。他的重点不在构造,在于后边的调用。

省略写法,好隐晦,差点儿没看懂

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

3 participants