Early Access Program Features

GoLand EAP 20: Go Build Run Configuration and Other Improvements

Hurray! A fresh GoLand EAP is now out. One of the most notable changes in this update is a new type of run configuration: Go Build. This run configuration replaces the Go Application run configuration, and it basically runs the Go build command. You can configure this run configuration for a file, package or directory:

If the build command produces a binary, the IDE will run it. Otherwise, the IDE will simply show the build output. If you don’t want to run the binary, you can uncheck the corresponding option.

We hope with this addition your workflow and build process, in general, will now be even more straightforward.

Last but not least, the Status Bar now includes a widget (on the right-hand side) for quick access to the Go settings, UI theme, keymap, plugins, etc.

In addition to these improvements, the update has some bugfixes. Please give the update a thorough try and share your feedback with us in our issue tracker!

Happy developing!

Comments below can no longer be edited.

10 Responses to GoLand EAP 20: Go Build Run Configuration and Other Improvements

  1. Avatar

    Eric D. Brown says:

    December 12, 2017

    Well, I did use this… now I’m using your GoLand (licensed version). I’m trying to cross-compile an app for linux while using GoLand on Windows. I set the environment variables as such, etc.; however, it seems your IDE automatically casts the -o build tag to go build and automatically generates a filename w/ an .EXE extension (again, even though it’s a built linux file). There’s GOT to be a way to override this -o flag you’re setting, or have the IDE be smart enough to know by looking at the environment flags on build what to do.

    Any advice? I COULD’VE made a script to change the name automatically after the build; however, your external tools only run BEFORE build. Again, roadblocked.

  2. Avatar

    Jaxon Pickett says:

    March 13, 2018

    GoLand license version user here. Is there a way to create a ‘go run’ run config, or have the binary output of the ‘go build’ command removed after the run completes? Don’t want the binary checked in to source control. Of course I can delete after but I would like that automated.


    • Avatar

      Morris Winkler says:

      March 26, 2018

      Add Bash build option with:

      Script: run
      Interpreter path: /usr/local/bin/go
      Program arguments: main.go
      Working directory: /home/user/go/src/somePKG/

      Sometimes I think JetBrains uses Kotlin developers to build goland.

  3. Avatar

    Sonia Hamilton says:

    March 26, 2018

    Thanks Andrey, the new build feature is great. My question: how do build so that my executable reads from stdin? For example, I’ve configured a ‘Run Configuration’ of type ‘File’, and it successfully builds a binary named ‘tennis’. If I do the following from the shell, it’s successful:

    ./tennis < game1.txt

    However, if I fill 'Program arguments' with '< game1.txt' the executable hangs waiting to read from stdin. I know the executable is running successfully because on the first line of my code I print to stdout.

    For the moment, as a workaround I'm manually reading the file in my code. But I live in hope of a better solution.

    fmt.Println("running ok!")
    foo, _ := os.Open(game1.txt")
    var n int
    fmt.Fscan(foo, &n)
    fmt.Println("n is:", n)

  4. Avatar

    Chris Rizzo says:

    October 1, 2018

    Where does JetBrains Goland put the binary executable that is built? It seems I can only run the program from within JetBrains, there is not binary written out to the file system, or if there is, then it is putting it in some unknown temp directory? I do not have GOBIN env set in JetBrains, but even so, the binary does not show up in the base src directory where the code is at, and it does not show up in ~/go/bin either.

  5. Avatar

    Yakov says:

    September 19, 2019

    How can I add -I flag to the build to compile faster?

    • Avatar

      Florin Pățan says:

      September 24, 2019

      GoLand will automatically add the `-i` (lower case “i”, not to be confused with lower case “L”), as you can see in the screenshot.
      However, that parameter is not really needed post-Go 1.10 as the new caching system will compile packages incrementally as they change.
      You can see what GoLand executes by expanding the “4 go setup calls” line in the Run Window and observing the `go build` call.
      If you do have issues with the compilation speed, please let us know more details about this and how we can reproduce them.

  6. Avatar

    Akshay says:

    January 18, 2020

    My Go Build is not running the project when run under packages
    It shows below

    GOROOT=/home/administrator/sdk/go1.13.5 #gosetup
    GOPATH=/home/administrator/go #gosetup
    /home/administrator/sdk/go1.13.5/bin/go build -i -o /tmp/___go_build_myinfo_services myinfo_services #gosetup
    /tmp/___go_build_myinfo_services #gosetup

    Process finished with exit code 0

    • Avatar

      Florin Pățan says:

      February 3, 2020

      Open your run configuration, `Run | Edit Configurations… | ` and see if the `Run after build` checkbox is checked.

Discover more