ARTIFACTORY: Why does GOPROXY contain |direct after running jf go-config?

Products
Frog_Artifactory
Content Type
Use_Case
AuthorFullName__c
Akshay P
articleNumber
000007046
FirstPublishedDate
2026-07-15T10:30:15Z
lastModifiedDate
2026-07-15

ARTIFACTORY: Why does GOPROXY contain |direct after running jf go-config?

Summary
This article explains the difference between the “,” (comma) and “|” (pipe) separators in GOPROXY when configuring a Go project with jf go-config, and why the JFrog CLI uses |direct by default.
The Issue
After configuring a Go project using jf go-config and inspecting the resolver URL with jf go env GOPROXY, you may notice that the value contains the suffix |direct appended to the Artifactory Go repository URL. For example:
https://<user>:<token>@<artifactory-host>/artifactory/api/go/<go-repo>|direct

This behavior is expected. The |direct suffix is part of the standard Go GOPROXY syntax and is intentionally added by the JFrog CLI to enable fallback to the upstream VCS when modules cannot be resolved through Artifactory.
The Go GOPROXY environment variable supports multiple proxy entries separated by either a comma (,) or a pipe (|).
  • “,” falls back to the next entry only when the previous proxy returns 404.
  • “|” falls back to the next entry on any error, including network failures, HTTP 5xx responses, authentication failures, or timeouts.
The JFrog CLI configures GOPROXY as:
<artifactory-url>|direct

Instead of:
<artifactory-url>,direct

This ensures builds can continue by downloading modules directly from the upstream VCS if Artifactory is temporarily unavailable or cannot serve the requested module.
Resolution
No action is required. The |direct suffix is the default and recommended behavior.

If your environment requires Artifactory-only module resolution (for example, in an air-gapped environment), it is possible to disable the fallback by using:
jf go build --no-fallback=true

jf go-publish <version> --no-fallback=true

With --no-fallback=true, the CLI does not append |direct to GOPROXY, and the build fails if Artifactory cannot resolve a module.

References:
https://go.dev/ref/mod#module-proxy
https://docs.jfrog.com/artifactory/docs/jf-go