diff --git a/clues.go b/clues.go index 2501f28..c90aa1a 100644 --- a/clues.go +++ b/clues.go @@ -198,12 +198,12 @@ func AddCommentTo( // --------------------------------------------------------------------------- // AddAgent adds an agent with a given name to the context. What's an agent? -// It's a special case info gatherer that you can spawn to collect clues for +// It's a special case data adder that you can spawn to collect clues for // you. Unlike standard clues additions, you have to tell the agent exactly -// what data you want it to Gather() for you. +// what data you want it to Relay() for you. // // Agents are recorded in the current clues node and all of its descendants. -// Data gathered by the agent will appear as part of the standard data map, +// Data relayed by the agent will appear as part of the standard data map, // namespaced by each agent. // // Agents are specifically handy in a certain set of uncommon cases where @@ -220,10 +220,10 @@ func AddAgent( return setDefaultNodeInCtx(ctx, nn) } -// Gather adds all key-value pairs to the provided agent. The agent will -// record those values to the dataNode in which it was created. All gathered +// Relay adds all key-value pairs to the provided agent. The agent will +// record those values to the dataNode in which it was created. All relayed // values are namespaced to the owning agent. -func Gather( +func Relay( ctx context.Context, agent string, vs ...any, diff --git a/clues_test.go b/clues_test.go index 506f38c..f96bbb3 100644 --- a/clues_test.go +++ b/clues_test.go @@ -708,8 +708,8 @@ func TestAddAgent(t *testing.T) { }, true) ctxWithWit := clues.AddAgent(ctx, "wit") - clues.Gather(ctx, "wit", "zero", 0) - clues.Gather(ctxWithWit, "wit", "two", 2) + clues.Relay(ctx, "wit", "zero", 0) + clues.Relay(ctxWithWit, "wit", "two", 2) mapEquals(t, ctx, msa{ "one": 1, @@ -725,7 +725,7 @@ func TestAddAgent(t *testing.T) { }, true) ctxWithTim := clues.AddAgent(ctxWithWit, "tim") - clues.Gather(ctxWithTim, "tim", "three", 3) + clues.Relay(ctxWithTim, "tim", "three", 3) mapEquals(t, ctx, msa{ "one": 1, @@ -744,7 +744,7 @@ func TestAddAgent(t *testing.T) { }, true) ctxWithBob := clues.AddAgent(ctx, "bob") - clues.Gather(ctxWithBob, "bob", "four", 4) + clues.Relay(ctxWithBob, "bob", "four", 4) mapEquals(t, ctx, msa{ "one": 1, diff --git a/datanode.go b/datanode.go index 4081816..70ed4ad 100644 --- a/datanode.go +++ b/datanode.go @@ -61,7 +61,7 @@ type dataNode struct { // from leaf to root when looking for populated labelCounters. labelCounter Adder - // agents act as proxy dataNodes that can gather specific, intentional data + // agents act as proxy dataNodes that can relay specific, intentional data // additions. They're namespaced so that additions to the agents don't accidentally // clobber other values in the dataNode. This also allows agents to protect // variations of data from each other, in case users need to compare differences