Loading...
Go's explicit error handling and strict typing make flag cleanup more predictable than in dynamic languages — but LaunchDarkly's SDK still lets you scatter `BoolVariation` calls across packages. FlagShark uses `go/ast` to find every one of them.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
func handleCheckout(w http.ResponseWriter, r *http.Request) {
ctx := ld.ContextFrom(r)
showExpressCheckout, _ := ldClient.BoolVariation("express-checkout", ctx, false)
if showExpressCheckout {
renderExpressCheckout(w, r)
return
}
renderStandardCheckout(w, r)
}func handleCheckout(w http.ResponseWriter, r *http.Request) {
renderExpressCheckout(w, r)
}FlagShark uses go/ast package for type-safe detection of SDK usage patterns to find every call to variation(), variationDetail(), boolVariation(), stringVariation()across your Gin, Echo, standard library codebase.
Each detected flag key is matched against your LaunchDarkly project to check rollout status, last evaluation date, and whether the flag is archived or still active.
For each stale flag, FlagShark creates a pull request that removes the SDK call, eliminates the dead code branch, and preserves the winning path. Every PR includes a before/after diff you can review.
Go interface abstractions are common in well-structured services — when the LaunchDarkly client is injected behind an interface, FlagShark must trace through the interface implementation to detect which concrete SDK methods are called.
Grep misses flags behind abstractions. AST-level scanning catches SDK calls that regex can't.
Every cleanup goes through code review. No surprises, no broken builds.
Only flags at 100% rollout for your configured threshold are suggested for removal.
New stale flags are detected automatically. Your codebase stays clean without manual audits.
variation()variationDetail()boolVariation()stringVariation()Plus custom patterns you define in .flagshark.yaml
FlagShark loads your Go module graph and walks the AST of every package, resolving calls to `BoolVariation`, `StringVariation`, `IntVariation`, and `JSONVariation` on the LaunchDarkly client. It follows interface assignments to catch injected clients.
Absolutely. FlagShark understands Gin handler chains and middleware stacks. It identifies flag checks in middleware and generates diffs that preserve your routing logic while stripping out dead branches.
Yes. If you use build tags to conditionally compile flag-related code, FlagShark detects those tags and warns you when a flag removal would require updating build constraints.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
A hands-on guide to finding and safely removing stale LaunchDarkly feature flags from TypeScript and React codebases.
Step-by-step process for identifying and removing dead LaunchDarkly flags in Django, FastAPI, and Flask applications.
Practical guide to removing stale LaunchDarkly flags from Spring Boot and Micronaut applications.
Find and safely remove LaunchDarkly feature flags buried in Rails controllers, views, and background jobs.
Leverage Rust's type system and FlagShark's syn-based analysis to remove stale LaunchDarkly flags from Actix and Axum services.
Use Roslyn analyzers and FlagShark to find and remove stale LaunchDarkly flags in ASP.NET Core and .NET services.
Identify and safely remove stale Split.io treatments from Go services using AST-based analysis.
Systematically identify and remove stale Unleash toggles from Go services and CLI applications.
Identify and remove unused PostHog feature flags from Go HTTP services and background workers.
Find and remove dead Flagsmith feature flags from Go web services and CLI applications.