2

I want to use VsCode for Go programming, but if I try to create/edit a .go file, VsCode forces me too install "gocode command", as you can see in the following:

Image.

When I click on install, the output field shows me these errors:

Errors_1

Errors_2

What can I do to fix it?

Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
Marcel Kämper
  • 304
  • 5
  • 16

1 Answers1

4

The error message says that your GOPATH is relative and should be absolute.

Make sure you read THIS first.

Make sure your GOPATH and GOROOT are defined in absolute paths.

Edit your .bashrc, .profile, .zshrc, etc accordingly:

GOPATH=/path/to/a/directory/inside/home/directory
GOROOT=/path/to/you/go/library

Read this answer for more details.

lloiacono
  • 4,714
  • 2
  • 30
  • 46