Skip to content

Commit

Permalink
Tidy more
Browse files Browse the repository at this point in the history
  • Loading branch information
DeividasK committed Feb 2, 2024
1 parent 3709f1a commit a5c8b66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions core/capabilities/capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ outerLoop:
}

setupErr := <-setupCh

// Something went wrong when setting up a capability.
if setupErr != nil {
return nil, setupErr
Expand Down
2 changes: 0 additions & 2 deletions core/capabilities/examples/on_demand_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ var info = capabilities.MustNewCapabilityInfo(
"v1.0.0",
)

// OnDemandTrigger is an example on-demand trigger.
type OnDemandTrigger struct {
capabilities.CapabilityInfo
chans map[string]chan capabilities.CapabilityResponse
mu sync.Mutex
}

// NewOnDemandTrigger returns a new OnDemandTrigger.
func NewOnDemandTrigger() *OnDemandTrigger {
return &OnDemandTrigger{
CapabilityInfo: info,
Expand Down
6 changes: 3 additions & 3 deletions core/capabilities/examples/on_demand_trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ func TestOnDemandTrigger_ChannelDoesntExist(t *testing.T) {

func TestOnDemandTrigger_(t *testing.T) {
tr := NewOnDemandTrigger()
ctx := context.Background()
ctx := testutils.Context(t)

req := capabilities.CapabilityRequest{
Metadata: capabilities.Metadata{
Metadata: capabilities.RequestMetadata{
WorkflowID: "hello",
},
}
Expand All @@ -71,7 +71,7 @@ func TestOnDemandTrigger_(t *testing.T) {
require.NoError(t, err)

er := capabilities.CapabilityResponse{
Value: &values.String{"hello"},
Value: &values.String{Underlying: testID},
}
err = tr.SendEvent(ctx, "hello", er)
require.NoError(t, err)
Expand Down

0 comments on commit a5c8b66

Please sign in to comment.