To extract a method from the expression at the caret or from a group of selected statements, press &shortcut:ExtractMethod; (Refactor | Extract | Method).
GoLand tips, #2083