Go Command-Line Options

The following table describes the command-line options that are specifically for translating Go code.

Go Option Description
-gopath <dir>

Specifies the root directory of your project. Make sure that the directory structure adheres to the Go workspace hierarchy (https://golang.org/doc/gopath_code.html). If this option is not specified, then the GOPATH system environment variable is used.

You must specify the gopath directory as an absolute path. The following examples are valid values for <dir>:

/home/projects/go_workspace/my_proj
C:\projects\go_workspace\my_proj

The following example is an invalid value for <dir>:

go_workspace/my_proj

If this option and the GOPATH system environment variable is not set, then the gopath defaults to a subdirectory named go in the user's home directory ($HOME/go on Linux and %USERPROFILE%\go on Windows), unless that directory contains a Go distribution.

Equivalent Property Name
com.fortify.sca.GOPATH

-goroot <dir>

Specifies the location of the Go installation. If this option is not specified, the GOROOT system environment variable is used.

If this option is not specified and the GOROOT system environment variable is not set, then Fortify Static Code Analyzer uses the Go compiler included in the Fortify Static Code Analyzer installation.

Equivalent Property Name
com.fortify.sca.GOROOT

-goproxy <url>

Specifies one or more comma-separated proxy URLs. You can also specify direct or off (to disable network usage).

If this option is not specified and the GOPROXY system environment variable is not set, then Fortify Static Code Analyzer uses https://proxy.golang.org,direct.

Equivalent Property Name
com.fortify.sca.GOPROXY 

See Also

Go Properties