steprun: PriorRuns reads a module's ReadSteps shape
Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -125,10 +125,14 @@ func (p *Puller) sayAskEnded(msg *Pulled, ask sdkstep.StepAsk, outcome, said str
|
||||
}
|
||||
}
|
||||
|
||||
// PriorRuns is Puller.Prior over a steps state's get (buildrun.Scan.Get): the Run of the step a key holds.
|
||||
func PriorRuns(get func(key string) (json.RawMessage, uint64, error)) func(string) int {
|
||||
// PriorRuns is Puller.Prior over a steps state's read (a module's ReadSteps.Get): the Run of the step a key holds. Nil for no
|
||||
// read (a test's), so the bus's delivery count stands.
|
||||
func PriorRuns(get func(key string) (json.RawMessage, error)) func(string) int {
|
||||
if get == nil {
|
||||
return nil
|
||||
}
|
||||
return func(key string) int {
|
||||
raw, _, err := get(key)
|
||||
raw, err := get(key)
|
||||
if err != nil || raw == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user