fix: address code review issues on PR #10 (HAN-384)
- runner.go: store fingerprints in local var, call formatter.SetFingerprints() instead of mutating caller's *Config; removes Fingerprints field from Config - fingerprint.go: use singleflight.Group in Query to coalesce concurrent probes for the same IP, eliminating the double-probe race - output layer: add SetFingerprints(map[string]string) to Formatter interface; textFormatter and jsonFormatter each hold their own fingerprints field - formatter_test.go: add TestTextFormatterWriteSummaryShowsVersions and TestJSONFormatterWriteSummaryShowsVersions verifying version output Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Copilot
multica-agent
parent
3e7580b919
commit
c96d18859f
@@ -31,7 +31,8 @@ func RunTraversal(ctx context.Context, traverser *traverse.Traverser, cfg *Confi
|
||||
// Gating on ShowServers avoids unnecessary network calls when versions
|
||||
// would not be displayed anyway.
|
||||
if cfg.ShowVersions && cfg.ShowServers {
|
||||
cfg.Fingerprints = fingerprint.New().FingerprintAll(ctx, collectUniqueServerIPs(results))
|
||||
fps := fingerprint.New().FingerprintAll(ctx, collectUniqueServerIPs(results))
|
||||
formatter.SetFingerprints(fps)
|
||||
}
|
||||
|
||||
if err := formatter.WriteSummary(results); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user