Command line arguments for Go

  • Updated

The contrast-go build tool accepts options that control how it instruments your application as it builds. Most of these options are for debugging only and can cause build errors or break Contrast functionality.

contrast-go [options] [build|help|install|run|version] [build flags] [packages]

These build time flags are supported:

OptionDefaultWhat it does

-v

off

Verbose logging in JSON format.

-vv 

off

Very verbose rewriter logging in JSON format. This produces a lot of output.

-d 

off

Dry run of the rewriting, for workflow validation.

-nodeps 

off

Instruments only packages within the target package's module and excludes dependencies.

-saveoff
Keeps the contrast-go temporary directory after the build.
-versionoff

Prints the contrast-go version and exits.

-dataflowon

Enables dataflow rewrites for Assess.

-ecuon

Enables ECU rewrites.

-gostmts on

Enables go statement rewrites for context propagation.

-events on

Enables rewrites that emit code events.

-go go

Overrides the command used to run Go.

 

Note

Use -h to get help.

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request