Documentation
¶
Index ¶
Constants ¶
const (
ID string = "v1.24.0"
)
Variables ¶
var BuildCommit string
BuildCommit is populated at link time via `-ldflags "-X github.com/chainguard-dev/malcontent/pkg/release.BuildCommit=<sha>"`. When unset, ResolveRuleURLCommit returns "" (callers fall back to "main").
Functions ¶
func PinRuleURLRef ¶ added in v1.24.0
func PinRuleURLRef(ref string)
PinRuleURLRef forces ResolveRuleURLCommit to return ref instead of deriving the value from BuildCommit. The pin is concurrency-safe: callers set it before scan goroutines start, but the atomic guarantees correctness under -race.
func ResetRuleURLRef ¶ added in v1.24.0
func ResetRuleURLRef()
ResetRuleURLRef clears any override set by PinRuleURLRef, restoring the default BuildCommit-based behavior. Exported for test cleanup.
func ResolveRuleURLCommit ¶ added in v1.24.0
func ResolveRuleURLCommit() string
ResolveRuleURLCommit returns the commit ref used in generated rule deep-link URLs. When an explicit pin has been set via PinRuleURLRef that value wins unconditionally. Otherwise a canonical 40-char lowercase hex BuildCommit, injected at link time by production builds, yields that pinned commit. Any other BuildCommit value yields ""; callers should fall back to "main" to produce a working URL rather than suppressing it.
Types ¶
This section is empty.