VScode for Golang – How to setup Visual Studio Code for Go [2020]

In this video we will look at how to setup visual studio code (VScode) for golang development. We will install necessary tools, the gopls language server, debugging, running your code, and more!

#johncodes

🚀 SUMMARY:
Today, we’re going to talk about using vscode with golang. The golang extension is a powerful tool to use with go development and provides alot of great features. Included with the golang extension is the gopls langauge server which provides fast performance for intellisense, completions, documentation, and more. It also has best in class go module support. If you’re using vscode for golang work, you’ll want to enable the gopls server. We will also talk about a few other extensions that make working with vscode much better. Again, vscode is highly extensible and customizable. It’s a powerful tool to use in your day to day work!

Download vscode: https://code.visualstudio.com/Download
Setup golang: https://golang.org/doc/install
VScode golang extension JSON configuration: https://github.com/golang/tools/blob/master/gopls/doc/vscode.md
Install dlv: https://github.com/go-delve/delve/tree/master/Documentation/installation

⏰ TIMESTAMPS:
00:00 Intro
00:30 Install tools & Go
02:59 Go extension configuration
05:48 Go extension features
06:30 Run tests
07:24 Building binaries
07:42 Debugging
10:41 More extensions

🔗 SOCIAL LINKS:
► Live on Twitch: https://johncodes.live
► Join the Discord: https://discord.gg/jk4uSKhx3e
► Twitter: https://twitter.com/johncodezzz
► Instagram: https://www.instagram.com/johncodezzz/
► TikTok: https://tiktok.com/@johncodes
► Home page: https://johncodes.com
► Email contact: hello@johncodes.com

🤔 About:
Hi all, I’m John, an experienced software engineer and open source software enthusiast. I make fun and informative videos about tech, engineering, productivity, and life! Like, comment, and subscribe for more!

source by John Codes

go programming language

Mourad ELGORMA

Fondateur de summarynetworks, passionné des nouvelles technologies et des métiers de Réseautique , Master en réseaux et système de télécommunications. ,j’ai affaire à Pascal, Delphi, Java, MATLAB, php …Connaissance du protocole TCP / IP, des applications Ethernet, des WLAN …Planification, installation et dépannage de problèmes de réseau informatique……Installez, configurez et dépannez les périphériques Cisco IOS. Surveillez les performances du réseau et isolez les défaillances du réseau. VLANs, protocoles de routage (RIPv2, EIGRP, OSPF.)…..Manipuler des systèmes embarqués (matériel et logiciel ex: Beaglebone Black)…Linux (Ubuntu, kali, serveur Mandriva Fedora, …). Microsoft (Windows, Windows Server 2003). ……Paquet tracer, GNS3, VMware Workstation, Virtual Box, Filezilla (client / serveur), EasyPhp, serveur Wamp,Le système de gestion WORDPRESS………Installation des caméras de surveillance ( technologie hikvision DVR………..). ,

28 réflexions sur “VScode for Golang – How to setup Visual Studio Code for Go [2020]

  • janvier 15, 2022 à 3:40
    Permalien

    Hi John, I was thinking to learn NodeJs as I am a frontend React developer. Now I am thinking to get hands-on experience with golang instead of NodeJs. My system has i3 2nd gen processor with 6gb RAM and no external graphics card support. Can I start learning with this laptop? And I want to watch your new video series on golang. I am new to it.

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    For git controls better for me "Git Graph" plugin. It look beter and usefull. You can see visail your branches. It's realy cool

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    May I know what software you use to make these videos? Like simultaneous capturing of your screen and video. It's pretty neat!

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    I'm reading the doc – it says "VS Code Go extension now enables the gopls language server by default", and it seems we no longer need to do anything!

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    Thanks for the content. I think vscode can be nice for a small project, but on a big project you can see some weird behavior. Debugging throws weird exceptions, breakpoints in go routines work randomly (sometimes it stops sometimes it doesn't), watches don't work most of the time, even watching a long string is difficult. When you have many files, suggestions don't work anymore and sometimes you can't even save a file. Overall i think it is difficult to do some serious programming in vscode.

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    The Link for "VScode golang extension JSON configuration" is outdated/ unavailable

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    Very useful, thank you. You have great presentation skills.

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    what a cute chipmunk. the one with glasses. dude took Gopher impersonation too seriously

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    Looks good till about 3:55. At that point pulling up "Preferences: Open Settings (JSON)" pulls up a Completely different segment of code (More like this):

    {

    "workbench.colorTheme": "In Bed by 7pm",

    "workbench.editorAssociations": [

    {

    "viewType": "jupyter.notebook.ipynb",

    "filenamePattern": "*.ipynb"

    }

    ],

    "python.defaultInterpreterPath": "C:\Users\cd0221\AppData\Local\Programs\Python\Python39\python.exe",

    "workbench.iconTheme": "Monokai Pro (Filter Ristretto) Icons",

    "terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe",

    "window.zoomLevel": 1,

    "code-runner.runInTerminal": true

    }

    Yes, Python is turned "Off", and I've selected Go as the language, so not sure why the wrong? JSON files is pulled up??

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    hallo sir, i want to ask something. If iam go mode in debugging go in vscode, why always go to proc.go everytime step? give me answer sir, if you know. Thank you

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    I'm getting an error saying " Failed to launch: could not launch process: can not run under Rosetta, check that the installed build of Go is right for your CPU architecture… where it wants me to launch.json ; what do I do? Mac m1 mini with rosetta

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    You are jumping from one subject to another skipping steps.

    Répondre
  • janvier 15, 2022 à 3:40
    Permalien

    I was trying to install those extensions and it said "cannot install go tools. set either go.gopath or go.toolsgopath in settings."

    Répondre
  • janvier 15, 2022 à 3:39
    Permalien

    your startup screen of vscode is full of “learning rust” projects… interesting… 🙂

    Répondre
  • janvier 15, 2022 à 3:39
    Permalien

    Hey all – VScode as of ~Feburary 2021 now enables the gopls server by default and much of the documentation has now moved into the upstream "golang" github org. So this video is a bit out of date.
    But, there are still some useful tidbits around enabling debugging, some of the settings, etc. Checkout the official repo for more documentation: https://github.com/golang/vscode-go

    Répondre

Laisser un commentaire