refactor: Run with config

This commit is contained in:
debugtalk
2021-09-22 20:12:33 +08:00
parent 4c2d7673fa
commit 9fb19da2ac
7 changed files with 13 additions and 10 deletions

View File

@@ -15,6 +15,7 @@ func Step(name string) *step {
type step struct {
runner *Runner
config *TConfig
*TStep
}
@@ -188,7 +189,7 @@ func (s *requestWithOptionalArgs) Type() string {
return fmt.Sprintf("request-%v", s.step.Request.Method)
}
func (s *requestWithOptionalArgs) Run() error {
func (s *requestWithOptionalArgs) Run(config *TConfig) error {
return s.runner.runStep(s.step)
}
@@ -216,6 +217,6 @@ func (s *testcaseWithOptionalArgs) Type() string {
return "testcase"
}
func (s *testcaseWithOptionalArgs) Run() error {
func (s *testcaseWithOptionalArgs) Run(config *TConfig) error {
return s.runner.runCase(s.step.TestCase)
}