Fixing Import Block Vanishment While Coding in Goland

Goland configuration guide

Trouble

Pressing Enter after typing import ( in Goland IDE will lead to an immediate vanishment of the import block.

Why Does the Import Block Vanish?

Goland’s default settings trigger automated format rules.

Specifically:
After pressing Enter, the formatting function was triggered, and it removes the import block.

Fix

Settings -> Go -> Imports -> Disable “Optimize imports on the fly”

Happy Coding!

Licensed under CC BY-NC-SA 4.0
Who comes from mountains, rivers, lakes and seas, yet is confined to days, nights, kitchen and love?