viaonly

command
v0.184.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

viaonly says where a rule is honoured at some siblings and not at others.

viaonly --wraps await --via '(*Peer).awaited' .          # call sites
viaonly --asks '(*Peer).gathered' --in '(*Peer).Offer' .  # exit points

The second rule, and why the first could not answer it, is in exits.go.

⛔ WHY IT EXISTS. go-crdt/collab shipped the same defect three times in four days: a rule honoured at some call sites and not at its siblings.

#247  RetryPolicy.Permanent asked about each attempt — one of two loops did
#268  the context's expiry returned through stalled() — two of three did
#271  the wait went through awaited() — ONE OF FIVE did

The third was born inside the fix for the second, and a CONSUMER measured it, not the author. A lesson that cannot stop its own recurrence in the commit that cites it is not a lesson, so this is a command instead of a note.

⛔ IT INFERS NOTHING. The pairing is DECLARED: --wraps names the callee, --via names the only function allowed to call it, and neither has a default. A tool that guessed which idiom a package "meant" would cry wolf, and a guard that cries wolf is a guard somebody turns off — this fleet has that measured twice over.

Exit status, following assetpath's and priorart's, and the same for both rules:

0  every call to --wraps is inside --via; or every exit of --in asked one
   of --asks
1  at least one call bypasses it, or one exit never asked; each is printed
   with its position
2  REFUSED TO DECIDE: the directory would not parse; a declared name is
   not in it; nothing was examined; every site is waived; or, under
   --asks/--in, the examined function contains a goto

⛔ The 2 is the whole point, as it is for assetpath. If --wraps resolves to no function, "0 direct calls" is true and worthless: the tool measured a name it could not find, not a package that obeys. A gate that passes because it had nothing to look at is worse than no gate, and this fleet has three memories of exactly that shape.

What it does not do yet

--wraps takes an UNQUALIFIED function name, because that is the shape the three defects above had: a package-level helper called from its own package. A dotted name is refused (exit 2) rather than half-matched on the selector, which would report calls to any method of that name on any receiver.

Test files are not scanned unless --tests is given, because a test calling the raw function directly is ordinary. The count of files skipped is printed, so the skipping is never silent.

⛔ --asks, the exit-point rule, DOES accept a method written (*T).name, and matches it by the spelling of the selector — the half-match --wraps refuses. The reason is the direction of the error: for "which call bypasses the wrapper" a half-match invents a finding, while for "did this exit ask the question" it can only invent a PASS, so the run says on every line that a call to that name on any receiver counts. Narrowing it needs go/types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL