“GoLand Can Do That?” Ten Secret Superpowers You Might Not Know
Note: This is a guest post from John Arundel, a Go writer and teacher who blogs at bitfieldconsulting.com. His most recent book is The Deeper Love of Go.
How do you break it to someone that they’ve wasted most of their life? Well, I worked with a guy who didn’t know how to copy and paste. Every time he wanted to move some code, he’d delete it and then grimly re-type the whole thing somewhere else, as I watched in silent dismay: “How do I tell him?”
It wasn’t that he didn’t want to be able to copy and paste. He just had no idea that he could – he’d never taken the time to fiddle around and find out.
That guy is all of us, in a way. Even if we can copy and paste, what other editor superpowers are we missing out on? And how much time are we wasting by not knowing about them? I’m just going to confidently say “Some”, right?
A modern IDE is more than just a text editor – it’s also a file manager, debugger, linter, AI assistant, and so on. Even better, an IDE like GoLand actually understands Go, so it can make suggestions as you type, highlight errors, annotate your code, and refactor automatically.
Here are ten things you might not know GoLand can do, and each one will make you more productive as a Go developer.
Search everywhere
90% of software engineering is just finding stuff, I reckon: where is that function defined? Where did I put that struct type?
Double-tap the Shift key in GoLand and type to search everywhere”: definitions, symbols, filenames, or even editor features. For example, enter search
to see all search-related settings.

Go to implementation
Cmd-click a function or variable name and GoLand will take you straight to its definition, even in another package or file (or even the standard library or your dependencies). And you can keep drilling down further until you find what you need, then use Cmd-[ to jump back.

Structure view
For a high-level overview of your constants, functions, types, and their associated methods, press Cmd-F12 to open the Structure view of your file or package. Click on any item to go to its definition.

Parameter names
GoLand shows inline hints for function calls, giving parameter names for each function argument. This makes reading code easier, especially when arguments are nil
, for example. You’ll also see name hints for results in a return
statement, and field names for struct literals that omit them.

Errors and warnings
Sure, GoLand can point out compile errors – an angry red underline indicates the offending code, and you can hover the mouse over it to see what’s wrong (or use the Inspection Lens plugin to see all errors inline without hovering). Saved you a compile-edit-fix cycle.
That’s great, but GoLand will also warn you about probable mistakes: unreachable code, unhandled errors, unused functions, redundant type conversions, or variable names that shadow the name of a package. Even though they’re technically legal (the best kind of legal), they’re likely not what you meant, and GoLand will pick these up and offer to auto-fix them.

Nil
pointer analysis
Ah, pointers! The cause of – and solution to – all programming problems. Specifically, pointers can be nil
(meaning “doesn’t point to any value”). That’s a problem if you try to dereference such a pointer (that is, ask Go to give you the value it points to), and by “problem” I mean “horrible crash”.
But how can you tell whether a pointer will be nil
at run time without running the program? Only by understanding the complete history of that variable throughout the code. Unfortunately, even GoLand isn’t yet smart enough to *touches earpiece* and I’m being told that in fact GoLand is now smart enough to do that.
The experimental data flow analysis feature simulates the execution of your program to catch run-time errors like nil
pointers even before you run it. That’s something I’ve never seen before in an IDE, and it’s pretty impressive.

Completions and templates
You’d expect GoLand to offer inline completions of function and variable names and so on, but that’s table stakes. Even more powerful are live templates: parameterized code snippets you can insert and complete interactively.
For example, if you want to write a for ... range
loop, type for
, and select For range loop from the picklist (or type forr
and press Tab). You’ll get a skeleton for
loop with placeholders for you to fill in the loop variables and body.
Similarly, if you get bored typing if err != nil...
repeatedly (but how could anyone find that boring?) GoLand can fill in the error-handling block for you, if you ask nicely.
Live templates automate dozens of the most common Go patterns and idioms, and you can create your own, with placeholders like $INDEX$
for parameters you want users to fill in.
Also, if you have a blob of JSON data that you need to turn into a Go type, just paste it into the editor. GoLand will offer to generate the struct definition for you automatically, complete with json
tags to make it parseable.

Refactoring
Do you ever wish you’d named your child something different? It might be a bit late to revisit that one, but fortunately it’s always possible to rename things in your Go programs, like functions and variables.
Manually retyping them everywhere would be annoying, and normal search-and-replace is error-prone (the Scunthorpe problem). GoLand is smarter about this because it understands Go: it knows if a word is a variable or function name, and avoids replacing it if it’s in some other context like inside a string or a comment.
Also, you can edit a function’s signature, adding or removing parameters as you like, and GoLand will automatically change the calls to that function everywhere.
Or try this one weird tip to slim down your chubby functions, and make your code beach body ready: select some lines and use Extract method to replace them with a call to a method that does the same thing. By eliminating paperwork, you make the program more readable and focus on what’s actually relevant.

Debugging
Now, I’m not saying you ever write bugs – perish the thought. Shall we say rather that programs occasionally don’t behave exactly the way we expect them to? Figuring out just where and why things are going wrong can be difficult, unless you can shrink down to the size of an electron and go inside the computer to see what’s happening (I’m still waiting on that Kickstarter).
Failing this, though, GoLand’s debugger is a pretty acceptable substitute. For example, set a breakpoint on a suspicious line and the debugger will stop the program there, keeping all variables intact so that you can inspect them (or edit them). Breakpoints can be conditional, too, so you only stop if a certain expression is true.
Then, if the problem still isn’t clear, you can Step Over to continue executing the code line by line, or Step Into to follow function calls down the rabbit hole.
To get really inside baseball, you can set a watch on the variables you’re interested in, or even arbitrary Go expressions, and see their values change as the program runs.

JetBrains AI tools
You were expecting this, right? Everything has AI now (or as I like to say, “Everything’s computer”). GoLand’s optional AI Assistant plugin is there, not to supplant your wonderfully human intelligence, but to support it.
For example, you can highlight some code and ask the assistant to explain it, suggest refactorings, or generate tests. You can ask it questions about the language or the standard library – all those “at this point I’m afraid to ask” things, and it won’t judge you.
Naturally, you can also use Junie, the JetBrains AI coding agent, as part of GoLand. You can ask Junie to write whole packages or programs for you, or to read a bunch of user requirements and sketch out a system design, then implement it.
If there’s some project you’ve always wanted to write, but you aren’t sure how to get started, collaborating with Junie could get you unblocked. Think of Junie as a pair programmer who doesn’t get bored or lose focus, and who can help you out with program structure and algorithms while still letting you have the fun of writing the interesting parts yourself.

There’s more
What’s that? Ten superpowers aren’t enough for you? You’ve got some attitude, mister. Look, GoLand can do more than we’ve had time to cover here – a lot more. But these ten things are a great place to start. Once you’ve mastered them, feel free to explore: read the docs, click around, try stuff out.
Don’t be like my non-copy-pasting friend, always too busy cutting wood to stop and sharpen the saw. A few minutes a day invested in really learning your IDE is time well spent. Pretty soon, these superpowers will become part of your muscle memory, just like copy and paste. (GoLand has that too. You’re welcome.)