Configuring folders within a content root
Within a content root, GoLand can distinguish between the folders that contain source code, and the ones to be ignored while searching, parsing, watching and so on. To distinguish different types of folders, mark any folder below a content root as a source folder or as excluded.
Within a content root, GoLand can distinguish between Resource Root and Excluded folders.
Files in the folder that is marked as resource root can be referenced relative to this folder. Excluded folders are not involved in indexing and therefore they are ignored while searching, parsing, watching, and other operations.
Marking directories
You can assign a folder to a category in two different ways:
In settings (Ctrl+Alt+S), under the Project Structure menu item.
In the Project tool window, by using the context menu of a folder.
Attach a directory to the project
Click
.In the file browser, navigate to the directory that you want to attach.
Click Open.
In the Open Project dialog, click Attach.
Detach a directory from the project
Right-click a directory that you want to detach and select Detach directory.
Mark directories under the content root
In the Settings/Preferences dialog (Ctrl+Alt+S), select Project Structure.
On the Project Structure page, click the desired content root. Directories under this content root are displayed as a tree view in the right-hand pane.
Select the directory you want to mark and do one of the following:
To have GoLand ignore the selected directory during indexing, parsing, code completion, and so on, click the Excluded toolbar button or choose Excluded from the context menu of the selection.
To enable GoLand to complete relative paths to resources under the selected folder, click the Resource Root toolbar button or choose Resource Root from the context menu of the selection.
Mark directories in the Project tool window
Right-click the desired directory in the Project tool window.
From the context menu, point to Mark Directory As node.
Choose Mark as <directory status>.
Reset the folder status
To reset a folder to its regular status, you need to unmark it.
Open settings (Ctrl+Alt+S) and click Project Structure.
Select the directory in the list of folders under the content root, and click the remove button . Alternatively, you can right-click the folder in the Project tool window and navigate to .