Whats New in v0.3.0-beta
?
Added the feature to pick between previous step returned values, or current step's arguments or use both as arguments to run the current step.
var steps = gosteps.Step{
Name: "add",
Function: funcs.Add,
StepArgs: []interface{}{2, 3},
NextStep: gosteps.Steps{
Name: "sub",
Function: funcs.Sub,
StepArgs: []interface{}{4, 6},
UseArguments: gosteps.CurrentStepArgs,
},
}
Available configurations for UseArguments
// only previous step return will be passed to current step as arguments
PreviousStepReturns stepArgChainingType = "PreviousStepReturns"
// only current step arguments (StepArgs) will be passed to current step as arguments
CurrentStepArgs stepArgChainingType = "CurrentStepArgs"
// both previous step returns and current step arguments (StepArgs) will be passed
// to current step as arguments - previous step returns, followed by current step args,
PreviousReturnsWithCurrentStepArgs stepArgChainingType = "PreviousReturnsWithCurrentStepArgs"
// both previous step returns and current step arguments (StepArgs) will be passed
// to current step as arguments - current step args, followed by previous step returns
CurrentStepArgsWithPreviousReturns stepArgChainingType = "CurrentStepArgsWithPreviousReturns"
Additionally renamed some fields like AdditionalArgs
is now StepArgs
. Defined types for Step Function, Step Chaining Type, etc. Also refactored and added Unit Tests.