GoLand 2019.2 Help

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:

  1. On the main menu, go to Navigate and select from one of the following:
    • Type Ctrl+N
    • File Ctrl+Shift+N
    • Symbol Ctrl+Shift+Alt+N
  2. 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:

      go goto type

    • File:

      go goto 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 \:

      go goto directory

    • Symbol:

      go goto symbol

  3. Click the desired entry in the suggestion list, or select it using the arrow keys, and press Enter.

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 shadowing or shadowed methods
  • Click the Navigate to shadowed method(s) icon (Navigate to shadowed methods), or press Ctrl+U.

  • Click the Navigate to shadowing method(s) icon (Go to shadowing methods), or press Ctrl+Alt+B.

Last modified: 29 October 2019