Add Go-related path into your Visual Studio Code in Ubuntu 18.04

I started learning Golang and having difficulties in configuration as there is no simple way to find where the hell is "howto config" guide.

Frustratingly googling didn't give good result until I found this blog in Chinese:
https://colobu.com/2016/04/21/use-vscode-to-develop-go-programs/

Kudos to you for writing it in a beginner friendly way!

In short:


  1. File -> Preferences -> User Setttings.
  2. In the search bar, just type "go" and it will list some suggested result.
  3. You will probably find like in this snapshot


  4. Click on "Edit in settings.json". It will open a new tab of "settings.json"
  5. Now go to your terminal and type run command "go env", press enter. You will get result similar to this: 

  6. Find relevant path needed such as GOPATH and GOROOT and add to "settings.json like this: 
  7. The naming convention for go setting are as the snapshot above. It use "go." and following with whatever needed for configuration. By right after typing "go", it should auto-list some recommendation that you can scroll and find what you need as in snapshot below.

My english probably shit, but you'll get it what my problem is.
If it is helpful, then I am glad.
If not then I am sorry, hopefully you will find the solution you probably need.

Comments

Popular posts from this blog

This is how I understand Data Encapsulation

TWRP cannot flash Magisk on Redmi 4x

Setting Environment variable for Android on Windows 10