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 学习笔记》第四版 P103 小错误 #54

Open
shuaihanhungry opened this issue Sep 10, 2017 · 0 comments
Open

《Go 学习笔记》第四版 P103 小错误 #54

shuaihanhungry opened this issue Sep 10, 2017 · 0 comments

Comments

@shuaihanhungry
Copy link

// 注意 p 是 Value 类型,需要还原成接⼝口才能转型。 
fmt.Println(u, p.Interface().(User))

需要改为

// 注意 p 是 Value 类型,需要还原成接⼝才能转型
fmt.Println(u, p.Elem().Interface().(User))
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