From 1ff05a73d7d0523a40dda91dde32415d13ac1c03 Mon Sep 17 00:00:00 2001 From: Webb Scales Date: Mon, 29 Jul 2024 11:52:29 -0400 Subject: [PATCH] Restrict received-signals chanel type to receive-only --- atp/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atp/client.go b/atp/client.go index cfffb96..e0c6fba 100644 --- a/atp/client.go +++ b/atp/client.go @@ -36,7 +36,7 @@ type Client interface { // ReadSchema reads the schema from the ATP server. ReadSchema() (*schema.SchemaSchema, error) // Execute executes a step with a given context and returns the resulting output. Assumes you called ReadSchema first. - Execute(input schema.Input, receivedSignals chan schema.Input, emittedSignals chan<- schema.Input) ExecutionResult + Execute(input schema.Input, receivedSignals <-chan schema.Input, emittedSignals chan<- schema.Input) ExecutionResult Close() error Encoder() *cbor.Encoder Decoder() *cbor.Decoder @@ -165,7 +165,7 @@ func (c *client) validateVersion(serverVersion int64) error { func (c *client) Execute( stepData schema.Input, - receivedSignals chan schema.Input, + receivedSignals <-chan schema.Input, emittedSignals chan<- schema.Input, ) ExecutionResult { c.logger.Debugf("Executing plugin step %s/%s...", stepData.RunID, stepData.ID) @@ -271,7 +271,7 @@ func (c *client) getRunningStepIDs() string { // Listen for received signals, and send them over ATP if available. func (c *client) executeWriteLoop( runID string, - receivedSignals chan schema.Input, + receivedSignals <-chan schema.Input, ) { c.mutex.Lock() if c.done {