To join two lines into one and remove unnecessary spaces, press &shortcut:EditorJoinLines;.

GoLand tips of the day, build 2078