Skip to content

flaglint-go scan

flaglint-go scan walks a directory and reports every detected LaunchDarkly Go SDK call site as a structured inventory — no risk scoring, no readiness score, just the raw findings. Use audit instead when you want a risk-ranked summary.

Terminal window
flaglint-go scan [dir] [flags]
FlagDescription
-f, --format stringOutput format: json | markdown (default markdown)
-o, --output stringWrite report to a file instead of stdout
--config stringPath to config file
--strict-typesAdditionally resolve findings only provable with real go/types information (interface satisfaction, transitive factory wrapping, cross-function method-value forwarding). Requires the module to build. See Identity Model.
# FlagLint Go Scan Report
Scanned 2 file(s) in 0ms — 2 unique flag(s) across 2 call site(s).
## Flags
| Flag | Call Type | Risk | File |
|---|---|---|---|
| `checkout-v2` | BoolVariation | low | checkout.go:13 |
| `discount-percentage` | IntVariation | low | checkout.go:20 |
{
"scannedFiles": 2,
"totalUsages": 2,
"uniqueFlags": ["checkout-v2", "discount-percentage"],
"usages": [
{
"flagKey": "checkout-v2",
"isDynamic": false,
"file": "checkout.go",
"line": 13,
"column": 16,
"callType": "BoolVariation",
"fingerprint": "launchdarkly:BoolVariation:checkout-v2:checkout.go",
"stalenessSignals": [],
"language": "go",
"sdk": "go-server-sdk-v7",
"risk": "low"
}
],
"warnings": []
}

Fingerprints (launchdarkly:callType:flagKey:normalizedPath[:dynamicIndex]) are stable across line-number changes and match flaglint-js’s format byte-for-byte — see the cross-tool contract.

scan always exits 0 unless the tool itself errors (invalid directory, bad --format, unreadable config). It never fails based on what it finds — use flaglint-go validate for a CI gate.