@@ -165,13 +165,15 @@ build steps, you may need to explicitly define each step in the command line.
165165
166166.. pull-quote :: Creating databases for Go
167167
168- For Go, you should always use the CodeQL autobuilder. Install the Go
169- toolchain (version 1.11 or later) and, if there are dependencies, the
170- appropriate dependency manager (such as `dep
168+ For Go, install the Go toolchain (version 1.11 or later) and, if there
169+ are dependencies, the appropriate dependency manager (such as `dep
171170 <https://golang.github.io/dep/> `__).
172171
173- Do not specify any build commands, as you will override the autobuilder
174- invocation, which will create an empty database.
172+ The Go autobuilder attempts to automatically detect code written in Go in a repository,
173+ and only runs build scripts in an attempt to fetch dependencies. To force
174+ CodeQL to limit extraction to the files compiled by your build script, set the environment variable
175+ `CODEQL_EXTRACTOR_GO_BUILD_TRACING=on ` or use the ``--command `` option to specify a
176+ build command.
175177
176178Specifying build commands
177179~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -200,6 +202,14 @@ commands that you can specify for compiled languages.
200202
201203 codeql database create csharp-database --language=csharp --command='dotnet build /p:UseSharedCompilation=false /t:rebuild'
202204
205+ - Go project built using the ``COEQL_EXTRACTOR_GO_BUILD_TRACING=on `` environment variable::
206+
207+ CODEQL_EXTRACTOR_GO_BUILD_TRACING=on codeql database create go-database --language=go
208+
209+ - Go project built using a custom build script::
210+
211+ codeql database create go-database --language=go --command='./scripts/build.sh'
212+
203213- Java project built using Gradle::
204214
205215 codeql database create java-database --language=java --command='gradle clean test'
0 commit comments