custom arguments for 'build' and 'run'

Answered

Hi,

I'm trying to run a project that requires custom parameters when building (something like -buildmode=plugin some_other_file.go) and other set of parameters when running it (input files to process). Is this possible using the run/debug configuration? I've tried some combinations using the Go tools arguments and Program arguments but haven't had any luck yet. Any help would be appreciated it.

Thanks

0
1 comment

Hi,

It is possible to pass custom arguments using run configurations.

  • Go tool arguments are arguments for Go tool as buildmode=plugin in your example. They're passing to binary compilation process: go build -arguments.
  • Program arguments are arguments for your program, e.g., input files to process. They're passing to binary execution process: ./binary arguments.txt. Please keep in mind that for Go plugins you should specify -o argument (Go tool one) for shared object library files (.so).

Please see Run/debug configurations section for more details: https://www.jetbrains.com/help/go/run-debug-configuration.html

We can consider your particular case and investigate what arguments you want to pass and how to do it properly.

0

Please sign in to leave a comment.