Skip to content

Commit

Permalink
fix var naming
Browse files Browse the repository at this point in the history
  • Loading branch information
hyorigo committed Jul 22, 2024
1 parent 2683c99 commit f6bca22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/net/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

0 comments on commit f6bca22

Please sign in to comment.