Go Support in VSCode

Stephen Grider
A free video tutorial from Stephen Grider
Engineering Architect
4.7 instructor rating • 30 courses • 838,642 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 July 2021

  • 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 TVs code editor, we're going to do just a tiny bit of configuration to it to set up to work nicely with going so out of the box TVs 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 go 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 nav menu up here. So here is the top menu bar. I'll 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 that 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 in 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 one to three million downloads. And so we'll 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 it's extension while fantastic, and it adds 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 straightforward, all we have to do is close the code editor. So we're going to quit Visual Studio Code entirely and then start it right back up. So I'm going to start right back up. And then 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 into, 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 and go. And I should see an option here of go. Now, when I do that, you're going to 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 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 of voice 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 to 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.