Complete Current Statement

Add trailing commas or braces and move the cursor with a single keystroke

GoLand can complete statements and add required trailing commas for any composite literals (like struct, slice, etc.), and even place caret in a position where you can just start typing the next statement.

How to use:

After typing parentheses, trigger the Complete Current Statement action, ⌃⇧⏎ (macOS) / Ctrl+Shift+Enter (Windows/Linux), to add curly braces and move ethe cursor down to the beginning of the next row.


Related Resources

Better time format in completion
Better time format in completion
Use the commonly known date/time formatting strings while writing time formatting in Go
Code Completion in Language Injections
Code Completion in Language Injections
See how to use code completion inside strings and other places
Completion for non-imported Go Modules
Completion for non-imported Go Modules
Import a module even if it was imported or used in your project