Skip to content

Commit

Permalink
fix(SXMC-198): Use declared ctx variable to bypass compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
alk-ktouchie committed May 8, 2024
1 parent bcf307d commit 707c127
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 4 deletions.
4 changes: 2 additions & 2 deletions checkers/unused/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ func (e Error) Error() string {
}

// Check checks that all nodes are used in one way or another:
// - have only one error output
// - are used explicitly
// - have only one error output
// - are used explicitly
func Check(graph goflow.GraphRenderer) error {
nodes := graph.Nodes()

Expand Down
1 change: 1 addition & 0 deletions wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package goflow
// - NodeWrapper
// - Linter
// - Checker
//
// goflow provides functions to use those simpler types as GraphWrappers.
type GraphWrapper func(unmarshal func(interface{}) error, graph GraphRenderer) (GraphRenderer, error)

Expand Down
45 changes: 45 additions & 0 deletions wrappers/mockingjay/graph/mockingjay.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions wrappers/mockingjay/mockingjay.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func WithMock(ctx context.Context, nodeID string, values ...interface{}) context
//
// The WithMock helper function is provided to make it easier to mock node:
//
// ctx := mockingjay.WithMock(ctx, "myNode", 42)
// graph.Run(ctx, ...)
// ctx := mockingjay.WithMock(ctx, "myNode", 42)
// graph.Run(ctx, ...)
func Mock(_ func(interface{}) error, node goflow.NodeRenderer) (goflow.NodeRenderer, error) {
return mocker{
NodeRenderer: ctx.Injector{
Expand Down
7 changes: 7 additions & 0 deletions wrappers/mockingjay/mockingjay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@ nodes:
a: inputs.a
b: inputs.b

- id: print
type: nodes.PrinterCtx
bind:
values:
- '"sum"'
- add.sum

outputs:
sum: add.sum

0 comments on commit 707c127

Please sign in to comment.