From f6bca224155f46294e17b5a3113896b1c7762604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hyori=20=ED=9A=A8=EB=A6=AC?= Date: Tue, 23 Jul 2024 01:02:52 +0800 Subject: [PATCH] fix var naming --- lib/net/ping.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/net/ping.go b/lib/net/ping.go index 7dc0f5e..8b5bd91 100644 --- a/lib/net/ping.go +++ b/lib/net/ping.go @@ -37,7 +37,6 @@ func goPingWrap(ctx context.Context, address string, count int, timeout, interva if len(rttDurations) == 0 { return nil, fmt.Errorf("no successful connections") } - return rttDurations, nil } @@ -178,10 +177,11 @@ func starHTTPing(thread *starlark.Thread, b *starlark.Builtin, args starlark.Tup } // perform the HTTP ping, and get the statistics + address := url.GoString() ctx := dataconv.GetThreadContext(thread) - rtts, err := goPingWrap(ctx, url.GoString(), count, time.Duration(timeout)*time.Second, time.Duration(interval)*time.Second, httpPingFunc) + rtts, err := goPingWrap(ctx, address, count, time.Duration(timeout)*time.Second, time.Duration(interval)*time.Second, httpPingFunc) if err != nil { return none, fmt.Errorf("%s: %w", b.Name(), err) } - return createPingStats(url.GoString(), count, rtts), nil + return createPingStats(address, count, rtts), nil }