Skip to content

Commit

Permalink
Restrict received-signals chanel type to receive-only
Browse files Browse the repository at this point in the history
  • Loading branch information
webbnh committed Jul 29, 2024
1 parent 949222e commit 1ff05a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions atp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1ff05a7

Please sign in to comment.