Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio code and vagrant integration

I am using MacOS and vagrant for Go development. I don't want install any development packages like Go, npm etc. on my host machine (MacOS). All of dev softwares installed on vagrant.

But there is a problem with vscode-go plugin, Because it requires few go packages like go vet, goimport etc. those packages installed on remote host (vagrat)

So how can I say to vscode that run these commands on remote host?

like image 929
alioygur Avatar asked Nov 08 '22 17:11

alioygur


1 Answers

Make a nfs share on the GOPATH environment variable in vagrant. On your Mac define also a GOPATH env variable. That way vscode can install the tools on your vagrant.

Although not sure this covers Mac vs Linux binaries.

Another approach might be too create bash aliases/functions which invoke the command over ssh.

I wrote a blog post on how to set up vscode on windows. I would really recommend to install tools natively. Go tooling is small, super fast and doesn't add lot of bloat to your system. E.g. PHP ads lots of crap etc.

https://marcofranssen.nl/start-on-your-first-golang-project/

Might clarify some stuff for you.

like image 57
Marco Avatar answered Nov 12 '22 18:11

Marco