Go Support in VSCode

Stephen Grider
A free video tutorial from Stephen Grider
Engineering Architect
4.7 instructor rating • 28 courses • 692,561 students

Learn more from the full course

Go: The Complete Developer's Guide (Golang)

Master the fundamentals and advanced features of the Go Programming Language (Golang)

08:52:03 of on-demand video • Updated November 2020

  • Build massively concurrent programs with Go Routines and Channels
  • Learn the advanced features of Go
  • Understand the differences between commonly used data structures
  • Prove your knowledge with dozens of included quiz questions
  • Apply Interfaces to dramatically simplify complex programs
  • Use types to future-proof your code and reduce the difficulty of refactors
English [Auto] Now that we've installed the VS code editor we're going to do just a tiny bit of configuration to it to set up to work nicely with Golon. So out of the box vs code doesn't have any support for go it's only by installing a little extension. Do we kind of teach the the editor how to handle code. So let's get to it. I'll open up the Visual Studio code editor and then when I do I'm going to find the top. Now how many appear. So here's the top menu bar. Or find the option view. And then inside of there I'll find the option extensions. So here's extension's right here. Now this sidebar that pops up lists a ton of different extensions so we can install into our code editor. A lot of these different extensions add support for different languages. Inside the editor like say Python or C-Sharp right here. Now we want to search for a very particular extension. We're going to enter a search string of go. Now hopefully the first result that pops up is something that says Rich go language support for Visual Studio should have around 1 to 3 million downloads. And so just click the Install button to install it. Now I wish I could say that the installation process or the configuration for go was that easy. Unfortunately there's one more little step we have to do when we install this go. Language support extension right here. It's just really a bonding layer between our code editor and a set of underlying command line tools that are actually responsible for kind of doing some code quality checks of any open file. And so extension while fantastic and to add support to the language or to our editor for US we also have to make sure that it has the ability to install these extra tools that it needs to function properly. So to make sure that it installs these other tools really straight forward. All we have to do is close the code editor. So we're going to quit Visual Studio code entirely or then start it right back up. It's going to start right back up. And here's the kind of weird part. But just bear with me for a second. I'm going to make sure that I have a code editor window open. If you don't have a code window open like this one that we can actually type them to. You can go up to file and a new file up here and so boom I've got a code editor window open now on the bottom right hand side. You should see something down here that says plain text. So we're going to click that we're going to change the language mode of the editor to go so I'll type in go and I should see an option here of go. Now when I do that you'll see this yellow text down here at the very bottom right hand side something that says analysis tools missing. And so these are the extra tools that the GO extension needs to make sure that it can kind of vet your code quality inside of your editor. So we're going to click on this and that's going to prompt us to install a couple of analysis tools. So all we have to do is click install and we're going to see a terminal window pop up here and it's going to grab a couple of different tools and it should just take a second or two to finish up. So that's pretty much it. Now the next time that we open up a go file inside a VS code we should have a bunch of tools available to help us to write code analyze it and just make sure we're doing things correctly. So that's pretty much it for our code editor setup. Let's take a break come back in the next section and we're going to start talking about the first project that we're going to work on. So I'll see you in just a minute.