From 05e14a3f7c070932d613dead55dfb00b2f76d34d Mon Sep 17 00:00:00 2001 From: huangsimin Date: Thu, 9 Apr 2020 10:06:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D.=20=E9=80=92=E5=BD=92?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hunter.go | 4 ++-- hunter_test.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hunter.go b/hunter.go index 284d86e..2e99fa6 100644 --- a/hunter.go +++ b/hunter.go @@ -116,7 +116,7 @@ func (hunter *Hunter) recursionTasks(cxt *TaskContext) { tasknode := itask.(ITaskNode) task := tasknode.Task() - ncxt.curPath = cxt.parent.Path() + ncxt.curPath = cxt.current.Path() if itid, ok := task.(IIdentity); ok { ncxt.curTaskID = itid.GetID() } else { @@ -134,7 +134,7 @@ func (hunter *Hunter) recursionTasks(cxt *TaskContext) { after.After(cxt) } - tasknode.SetPath(cxt.parent.Path() + "." + ncxt.curTaskID) + tasknode.SetPath(cxt.current.Path() + "." + ncxt.curTaskID) ncxt.parent = cxt.current ncxt.current = tasknode hunter.recursionTasks(ncxt) diff --git a/hunter_test.go b/hunter_test.go index c35848e..218dba2 100644 --- a/hunter_test.go +++ b/hunter_test.go @@ -2,9 +2,14 @@ package hunter import ( "encoding/json" + "log" "testing" ) +func init() { + log.Println("测试最好使用 docker run -p 80:80 kennethreitz/httpbin") +} + type WebGet struct { PreGetUrl }