Navigation through the code
Overview
Navigate commands enable you to quickly jump to the desired types, files, or symbols specified by names. GoLand suggests a look-up list of matching names, from which you can select the desired one, and open it in the editor. This navigation honors CamelCase and snake_case capitalization.
Navigating by name
To navigate to a type, file, or symbol by its name:
- On the main menu, go to
- Ctrl+N
- Ctrl+Shift+N
- Ctrl+Shift+Alt+N
and select from one of the following: - In the popup, start typing the desired name.
So doing, you can enter characters located anywhere inside the desired name. As you type, the suggestion list shrinks, displaying the matching names only.
Type:
File:
Directory: use the same Ctrl+Shift+N shortcut as for file navigation, and type the name of the directory you are looking for, the pattern name ending with / or \:
Symbol:
Click the desired entry in the suggestion list, or select it using the arrow keys, and press Enter.
Navigate to shadowing or shadowed methods
In Go, you use shadowing or shadowed methods when you need to define two methods with the same name but that belong to different structs. For example, you have the display()
method in the SomeObject
struct, and you need to define the display()
method in the Circle
struct. In this case, the display()
method in the Circle
struct will shadow the display()
method of the SomeObject
struct.
Navigate to shadowed methods
Click the Navigate to shadowed method(s) icon (), or press Ctrl+U.
Navigate to shadowing methods
Click the Navigate to shadowing method(s) icon (), or press Ctrl+Alt+B.