Peppermint OS Community Forum

Support => New Users => Topic started by: maxiam on August 26, 2019, 05:18:03 am

Title: install VS Code (SOLVED)
Post by: maxiam on August 26, 2019, 05:18:03 am
I am trying to install VSCode to run Go-Lang.
As far as I can figure out, The config file .bashrc needs to be modified by adding
export GOPATH=$Home/go/GoCode
This is the path to the go workspace, as the go directory contains the install files, so I created this one :)This dosent work and VSCode gives me errors when running it. I have installed theMS go extention on VSCode. Can somebody pls help , thanks
Title: Re: install VS Code
Post by: Slim.Fatz on August 26, 2019, 08:54:17 am
Hi maxiam,

It looks like you made a mistake in the line you added to the .bashrc file. Linux is case-sensitive so try modifying the line to look like this:

Code: [Select]
export GOPATH=$HOME/go/GoCode
because the variable $Home does not exist, but $HOME does (it looks somethings like /home/maxiam). To see its actual current value open a terminal and enter this:

Code: [Select]
echo $HOME
and press the ENTER key. Doing the same for this:

Code: [Select]
echo $Home
should not return anything.  ;)


-- Slim
Title: Re: install VS Code
Post by: PCNetSpec on August 26, 2019, 09:40:17 am
Yeah as Slim.Fatz points out

$HOME is an environment variable equal to /home/<username> .. so $HOME/go/GoCode is the equivalent of /home/<username>/go/GoCode

Remember, case sensitivity **IS** important in Linux, so $Home is NOT the same as $HOME .. in fact $Home doesn't exists as an environment variable.


You could either make the line read
Code: [Select]
export GOPATH=$HOME/go/GoCode
or drop the environment variable altogether and specify the full path
Code: [Select]
export GOPATH=/home/<username>/go/GoCode
(obviously replacing <username> with your ACTUAL username.)

(and hopefully not muddying the waters further)

Another option would be to use the $USER variable to set the username in the path, so
Code: [Select]
export GOPATH=/home/$USER/go/GoCode
should also work.
Title: Re: install VS Code
Post by: maxiam on August 27, 2019, 01:34:37 am
Thank you for this.
Do I need to add anything else, such as PATH= or something. I have shown the echo $PATH as it exists benith., noticing that the /bin directory is referenced in the /go and in the /gocode directories.  Can I just add these lines to the bottom of the /.bashrc file? My g/gocode dir is actually /GoCode.


o@ao-HP-ENVY-m6-Notebook-PC ~ $ echo $PATH
ao@ao-HP-ENVY-m6-Notebook-PC ~ $
Title: Re: install VS Code
Post by: PCNetSpec on August 27, 2019, 03:22:38 pm
It's hard for us to say what you should do as we're not 100% sure what the goal is ?

Code: [Select]
export GOPATH=$HOME/go/GoCode
to ~/.bashrc will add an environment variable to the terminal called $GOPATH which points at /home/ao/go/GoCode

you can test this by running
Code: [Select]
xed ~/.bashrc
and adding this line at the bottom
Code: [Select]
export GOPATH=$HOME/go/GoCode
SAVE the file and exit the text editor.

Now back in a NEW terminal run:
Code: [Select]
echo $GOPATH
and you should get
Code: [Select]
Now what we can't tell you is if that's the correct directory path to the Go code as we don't know where you put it.
Title: Re: install VS Code
Post by: maxiam on September 02, 2019, 11:50:05 pm
Thanks for the help, how di I mark this as solve?
Title: Re: install VS Code
Post by: PCNetSpec on September 03, 2019, 07:30:50 pm
Edit the FIRST posting in your topic, and append (SOLVED) to the subject line .. so for example in this topic, edit the FIRST posting and change

Subject: install VS Code (SOLVED)


I've done this one for you :)