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.
- 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.
- 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.
- 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!
- 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!
- 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)
- 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!!
- Linting: expanded options, can now use revive, golangci-lint, generally more options since I guess there are more options!
- Seeing variables: Could see local vars, can now see package vars (see, wouldn’t have known this was newer, without this talk!)
- Can change the max length of strings (I don’t really understand what she means by this one, but okay)
- 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!