From ec3ada25ee54d89d55842e8984c7a13fa7cb6b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=9B=E5=BC=BA?= Date: Wed, 21 Apr 2021 16:24:24 +0800 Subject: [PATCH] change log print condition --- element.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/element.go b/element.go index 396644d..ca6d6b2 100644 --- a/element.go +++ b/element.go @@ -114,9 +114,13 @@ func (ele *Element) SearchFunc(fn func(*Element) bool) []*Element { if fn(el) { results = append(results, el) } - log.Print(el.walk(search)) + if err := el.walk(search); err != nil { + log.Print() + } + } + if err := ele.walk(search); err != nil { + log.Print() } - log.Print(ele.walk(search)) return results }