Loading...
Unleash's Go client gives you `IsEnabled` with context — clean and simple. But when toggle checks spread across middleware, handlers, and gRPC interceptors, manual cleanup gets tedious. FlagShark automates the entire process.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
func profileHandler(w http.ResponseWriter, r *http.Request) {
ctx := unleash.WithContext(context.TODO(),
unleash.Context{UserId: getUserID(r)})
if unleash.IsEnabled("enhanced-profile", unleash.WithContext(ctx)) {
renderEnhancedProfile(w, r)
} else {
renderBasicProfile(w, r)
}
}func profileHandler(w http.ResponseWriter, r *http.Request) {
renderEnhancedProfile(w, r)
}FlagShark uses go/ast package for type-safe detection of SDK usage patterns to find every call to isEnabled(), getVariant(), getAllToggles()across your Gin, Echo, standard library codebase.
Each detected flag key is matched against your Unleash 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.
Unleash's Go SDK uses functional options like `unleash.WithContext()` — when you remove a toggle, the context-building code may also become unnecessary, but leaving it behind won't cause errors, just dead code that lint tools will eventually flag.
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.
isEnabled()getVariant()getAllToggles()Plus custom patterns you define in .flagshark.yaml
FlagShark parses your Go modules with `go/ast` and identifies all calls to `unleash.IsEnabled()`, `unleash.GetVariant()`, and the client method equivalents. It follows functional option arguments to extract toggle names.
Yes. FlagShark detects toggle checks in gRPC unary and streaming interceptors, which is a common pattern for feature-gating entire service methods.
FlagShark identifies metric callbacks and toggle listeners registered during client initialization. When a toggle is removed, it flags these for cleanup to prevent metric reporting for non-existent toggles.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
Find and remove stale Unleash feature toggles from React, Next.js, and Node.js TypeScript projects.
Identify and safely remove stale Unleash toggles from Django, FastAPI, and Flask Python applications.
Find and remove dead Unleash toggles from Spring Boot applications and Java microservices.
Detect and safely remove stale Unleash feature toggles from Rails applications and Ruby services.
Use Rust's type system and FlagShark to find and remove dead Unleash toggles from Actix and Axum services.
How to find, evaluate, and remove unused LaunchDarkly feature flags from Go microservices and CLI tools.
Identify and safely remove stale Split.io treatments from Go services using AST-based analysis.
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.