Skip to content

Let’s Go Video: Whats New in VS Code for Go

This week, I watched a video on VS Code, which is timely since I recently started using it. As a reminder, videos in this series are added to a YouTube list over here.

While switching my focus to Golang, at first I continued using Atom, which does have at least a few good Go plugins available, under the thinking “you can change everything, but don’t change everything at once.” But noticing that members of my team tend to use VS Code, and also, seeing a discussion about adding Terraform 0.12 language support to VS Code, inspired me to download it and start using it more regularly.

Honestly, I was hoping to work on this support (combining new job skillz with supporting an editor maintained in JS!), but then got really discouraged because further research (found by other folks than I) found that someone already has built out a language server option, which is a preferred route to go for language support for editors. I’d like to help, but I’m a little frazzled/unsure of where it would be helpful to jump in with so many moving parts.

So this talk from last year’s GopherCon is a lightning talk (that goes a little past time) over some of the new features in VS Code for Golang (which is cool in any case, cause most of the features are new to me!).

Ramya Rao lost count in giving the talk, but she did cover 10 cool things in VS Code! Most of which were community contributed, which is pretty neat.

  1. Code lenses — the “Go to” handy things that allow you to jump to a definition (which are indeed super handy, and I’m digging that about VS Code) can now run benchmarks.
  2. You can cancel long running tests! This is uh, super useful for me, since tests generally just time out when Atom has been running them on projects that I’ve been working on 😅 But something she mentions later is even more helpful.
  3. Code coverage! Previously, you could either run coverage on command, or on save, which is kinda extreme. Now you can set it so you can run code coverage when you run all the tests in a package. Cool!
  4. Showing coverage in red/green is inaccessible to a lot of people. Now you can customize to your own RGB values, for what you prefer!
  5. Coverage notes: can move to the gutter rather than in code (I love this setting, because I hate having the noise in my code, so I generally find this in an editor quickly)
  6. Diagnostics: Previously, build/lint/vet are done on save. This is something that’s going to be very helpful to me since those can take forever. Thanks!!
  7. Linting: expanded options, can now use revive, golangci-lint, generally more options since I guess there are more options!
  8. Seeing variables: Could see local vars, can now see package vars (see, wouldn’t have known this was newer, without this talk!)
  9. Can change the max length of strings (I don’t really understand what she means by this one, but okay)
  10. Conditional breakpoints: Yeah these are useful, I’ve seen this in JS tooling for a long while, so glad to see it’s in Golang 🙂

A great short little talk, worth a watch (although seeing what’s happening in the editor is pretty difficult) if you use VS Code for Golang!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.