Skip to content

Go Module

Scan Go module files (.mod) for GitHub repository dependencies.

Scanning module files enables the compile pipeline to pull these repositories and scan their source files for symbols to build metadata dictionaries.

Configuration

To configure the Go module module, Edit these settings.

Below is the default configuration from: gomod/config.yaml (* Required Fields).

Edit Online

Edit config.yaml Locally

# 🔟❎ 'compile' Go module scanner configuration

# Configures the Go .mod scanner which pulls referenced GitHub repositories to scan for symbol values.

# To learn more see https://doc.log10x.com/compile/pull/gomod

# Set the 10x pipeline to 'compile'
tenx: compile

# =============================== Gomod Options ===============================

gomod:

  # 'token' specifies the access token for this repo using a shell variable (recommended) or inline
  #  To learn more see: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
  pullGitHubToken: $=TenXEnv.get("GH_TOKEN")  # (❗ EnvVar REQUIRED)

  # 'proxyURL' specifies a Go module proxy for downloading indirect module dependencies.
  #  If omitted, only process direct dependencies from the go.mod file.
  #  If provided, fetches indirect dependencies up to the specified max-depth.
  proxyURL: https://proxy.golang.org/

  # 'maxDepth' limits the depth of module dependency recursion
  #  Depth starts at 0 for the initial .mod file (direct deps), increments to 1 for first-level indirect deps, 
  #  and 2 for second-level, stopping before a third level (depth 3).
  maxDepth: 0

Options

Specify the options below to configure the Go module:

Name Description
gomodPullGitHubToken GitHub API token for pulling repositories
gomodProxyURL Go module proxy URL
gomodMaxRepos Limit the overall number of GitHub repos to pull
gomodMaxDepth Limit the depth of module dependency recursion

gomodPullGitHubToken

GitHub API token for pulling repositories.

Type Default
String ""

Defines an access token for pulling Github repos referenced by Go .mod files. If not set, do not pull GitHub repos for Go dependencies.

gomodProxyURL

Go module proxy URL.

Type Default
String https://proxy.golang.org

Specifies a Go module proxy for downloading indirect module dependencies. If omitted, only process direct dependencies from the go.mod file. If provided, fetches indirect dependencies up to the specified max-depth.

gomodMaxRepos

Limit the overall number of GitHub repos to pull.

Type Default
Number 200

Specifies a global limit for the number of repositories collected.

gomodMaxDepth

Limit the depth of module dependency recursion.

Type Default
Number 0

Depth starts at 0 for the initial .mod file (direct deps), increments to 1 for first-level indirect deps, and 2 for second-level, stopping before a third level (depth 3).

Depth Limit (2):

  • Level 0: Direct dependencies in your .mod file.
  • Level 1: Dependencies of those direct modules.
  • Level 2: Dependencies of level 1 modules.

Stops at level 3, covering two levels of indirect dependencies. For most Go projects, this captures the bulk of relevant GitHub repos without exploding runtime.

Example: If yourApp → golang.org/x/tools → github.com/golang/go, depth 2 gets both, but stops before fetching go’s deps.


This module is defined in gomod/module.yaml.