Answer the question
In order to leave comments, you need to log in
How do I set up IntelliSense for Go for Visual Studio Code?
Good day everyone! I'm currently writing a small Go tutorial project in Visual Studio Code. Autocomplete works, but only for standard packages like json. But for my packages it does not work.
For example:
package auth
import (
"encoding/json"
"../data"
"github.com/gorilla/websocket"
)
type RoomsManager struct {
Rooms map[string]*Room
ConnToRooms map[*websocket.Conn]*Room
AuthModule *AuthModule
}
func (rm *RoomsManager) AddRoom(roomName string) {
rm.Rooms[roomName] = &Room{
Name: roomName,
Players: [2]*Player{nil, nil},
}
}
Answer the question
In order to leave comments, you need to log in
The problem ended up being the gocode extension:
https://github.com/Microsoft/vscode-go/issues/1723...
You need to put your packages in the GOPATH/src/... directory, i.e. where packages are downloaded when added.
Then he will see.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question