GoLand: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 6: Line 6:
=Building=
=Building=
Also see: {{Internal|Go_Packages#Building_Packages|Building Packages}}
Also see: {{Internal|Go_Packages#Building_Packages|Building Packages}}
=Module-Aware or <tt>GOPATH</tt> Mode=
Module-aware mode is turned on by default.
To turn it off: Preferences → Go → Go Modules → Turn off "Enable Go modules integration".
Then set the correct GOPATH in Preferences → Go → GOPATH → Project GOPATH.
For more details see: {{Internal|Go_Language_Modularization#Module-Aware_or_GOPATH_Mode|Module-Aware or <tt>GOPATH</tt> Mode}}
=Turn Off "Optimize Imports oh the Fly"=
<font color=darkkhaki>Does not seem to work, must be set somewhere else.</font>
Preferences → Go → Imports → Uncheck "Optimize imports on the fly"
=Setup Debugging for a Project=
==Debugging Configuration==
===Configure Type Rendering===
Does not seem to have one, unlike PyCharm: [[PyCharm_Operations#Configure_Type_Rendering|PyCharm &#124; Configure Type Rendering]].
=Tabs and Indents=
Editor → Code Style → Go → Tabs and Indents → Uncheck "Use tab character"
There's also a bottom-right "Tab" control.
Note that by default the IDE is configured to run <code>gofmt</code> on "Reformat Code action" and <code>gofmt</code> replaces spaces with tabs. This is the convention, see: {{Internal|Go_Tool#fmt|<tt>go fmt</tt>}}

Latest revision as of 01:43, 31 August 2024

Internal

Overview

Building

Also see:

Building Packages

Module-Aware or GOPATH Mode

Module-aware mode is turned on by default.

To turn it off: Preferences → Go → Go Modules → Turn off "Enable Go modules integration".

Then set the correct GOPATH in Preferences → Go → GOPATH → Project GOPATH.

For more details see:

Module-Aware or GOPATH Mode

Turn Off "Optimize Imports oh the Fly"

Does not seem to work, must be set somewhere else.

Preferences → Go → Imports → Uncheck "Optimize imports on the fly"

Setup Debugging for a Project

Debugging Configuration

Configure Type Rendering

Does not seem to have one, unlike PyCharm: PyCharm | Configure Type Rendering.

Tabs and Indents

Editor → Code Style → Go → Tabs and Indents → Uncheck "Use tab character"

There's also a bottom-right "Tab" control.

Note that by default the IDE is configured to run gofmt on "Reformat Code action" and gofmt replaces spaces with tabs. This is the convention, see:

go fmt