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

x/tools/gopls: cannot navigate unsafe package from vscode thru gopls #43058

c3y28 opened this issue Dec 8, 2020 · 1 comment

x/tools/gopls: cannot navigate unsafe package from vscode thru gopls #43058

c3y28 opened this issue Dec 8, 2020 · 1 comment


Copy link

@c3y28 c3y28 commented Dec 8, 2020

What did you do?

edit below golang code in vscode with gopls used, try navigate Sizeof function to open unsafe.go

package main

import (

func main() {
	account := 100

What did you expect to see?

navigate from unsafe usage to unsafe.go in vscode when using gopls. if gopls is not used, vscode works to navigate on unsafe package

What did you see instead?

fail to navigate, showing "No definition found for 'Sizeof'", open unsafe.go in the same vscode window, will see the following problem on package line

Build info v0.5.5 h1:YBLs2WCwxx6mBF98Y6/mDIpKhP4Dt4Dz2q6LnMRBpDw= h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= h1:uxH+MECLNmX/vsPe4txyeQ1LCmhdUxf7p4hjkHexg+c= h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc= h1:z+/YqapuV7VZPvBb3GYmuEJbA88M3PFUxaHilHYVCpQ= h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
Copy link

@stamblerre stamblerre commented Dec 23, 2020

Thank you for the report. It looks like our use of types.Unsafe is not sufficient. Likely, the unsafe package needs to be given special treatment, much like the builtin package.

We will address this for gopls/v1.0.0, but we will not resolve this bug before February.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.