Choose style:

Author Topic: install VS Code (SOLVED)  (Read 229 times)

0 Members and 1 Guest are viewing this topic.

Offline maxiam

  • nOOb
  • *
  • Posts: 10
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 9
install VS Code (SOLVED)
« 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
« Last Edit: September 03, 2019, 07:31:46 pm by PCNetSpec, Reason: marked as (SOLVED) »

Offline Slim.Fatz

  • Trusted User
  • Veteran
  • *****
  • Posts: 1812
  • Karma: 474
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: install VS Code
« Reply #1 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.  ;)

Regards,

-- Slim
"Life first -- Peppermint a close 2nd!" -- Zeb

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26276
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: install VS Code
« Reply #2 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.

So..

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.)



FYI...
(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.
« Last Edit: August 26, 2019, 09:53:15 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline maxiam

  • nOOb
  • *
  • Posts: 10
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 9
Re: install VS Code
« Reply #3 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.

Andrew

o@ao-HP-ENVY-m6-Notebook-PC ~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ao/gocode/bin:/home/ao/go/bin
ao@ao-HP-ENVY-m6-Notebook-PC ~ $
[/size][/size][/size]

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26276
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: install VS Code
« Reply #4 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 ?

adding:
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]
/home/ao/go/GoCode
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.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline maxiam

  • nOOb
  • *
  • Posts: 10
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 9
Re: install VS Code
« Reply #5 on: September 02, 2019, 11:50:05 pm »
Thanks for the help, how di I mark this as solve?

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26276
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: install VS Code
« Reply #6 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)

[EDIT]

I've done this one for you :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec