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

post/dive-into-go-unsafe/ #6

Open
utterances-bot opened this issue Apr 3, 2023 · 1 comment
Open

post/dive-into-go-unsafe/ #6

utterances-bot opened this issue Apr 3, 2023 · 1 comment

Comments

@utterances-bot
Copy link

深度解密 Go 语言之 unsafe | qcrao 的博客

深度解密 Go 语言之 unsafe

https://qcrao.com/post/dive-into-go-unsafe/

Copy link

Hello,
这行代码是不是有点问题?
lang := (*string)(unsafe.Pointer(uintptr(unsafe.Pointer(&p)) + unsafe.Offsetof(p.language)))
偏移的应该是p.name, 然后lang才能指向p.language.
BR,
MM

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

2 participants