When I set up concurrent execution for the steps of a stage, I find that program always execute the last step.
Looking at the source code, I found closure functions used for concurrent execution, which I guess is where the bug came from.
// file stage.go
for _, step := range st.Steps {
step.Status("begin")
g.run(func() *Result {
defer step.Status("end")
//disables strict mode. g.run will wait for all steps to finish
if st.DisableStrictMode {
return step.Exec(request)
}
fmt.Println(step.getCtx().index, step.getCtx().name)
resultChan := make(chan *Result, 1)