GoLand
 
Get GoLand

Path variables

Last modified: 08 October 2024

Use path variables to define absolute paths to resources that are not part of a specific project. These external resources may be located in different places on the computers of your teammates. This is why user-defined custom path variables are not stored as project settings, but as global IDE settings. Once configured, such path variables will have the same value for any project that you open with your instance of GoLand.

You can use path variables to specify paths and command-line arguments for external tools and in some run configurations. For more information, refer to Built-in IDE macros.

For example, you can define a path variable that points to the location of some data source (like a CSV file) or a third-party library that is not stored in your project. If you use this path variable in a run configuration that you share with your project, others can define the correct value for this path variable in their environment and be sure that the run configuration will work for them.

Another example is defining a path variable for the attached directory that you use in your project. On another machine, the directory might be stored in a different location. To make sure your project with the attached directory can be shared and used on another machine, use path variables to define the location of the attached directory.

Refer to the variable as $var_name$ in fields and configuration files that accept path variables.

GoLand also has the following built-in path variables: