GoLand 2020.1 Help

Open files from the command line

Open an arbitrary file or folder in GoLand from the command line, optionally specifying where to put the caret after opening.

Syntax
goland.bat [--line <number>] [--column <number>] <path ...>
Examples

Open a project:

goland.bat C:\MyProject

Open a specific file on line number 42 column 7:

goland.bat --line 42 --column 7 C:\MyProject\main.go
Syntax
goland --line <number> <path>
Examples

Open a project:

goland ~/MyProject

Open a specific file on line number 42 column 7:

goland --line 42 --column 7 ~/MyProject/main.go
Syntax
goland.sh --line <number> <path>
Examples

Open a project:

goland.sh ~/MyProject

Open a specific file on line number 42 column 7:

goland.sh --line 42 --column 7 ~/MyProject/main.go

When you specify the path to a file or directory in an existing project, GoLand opens this project. If the file does not belong to a project, GoLand creates a temporary project for it. If you open a directory that is not a part of a project, GoLand adds the .idea directory to it, making it a project.

Last modified: 17 March 2020