From 09e692e3189d0f31d73b03575843ac584b4066bb Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 22 Oct 2021 09:12:00 -0700 Subject: [PATCH] health: don't look for UDP goroutines in js/wasm health check Updates #3157 Change-Id: I43d97e6876eeb2d1936fc567835134568bb8615c Signed-off-by: Brad Fitzpatrick --- health/health.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/health/health.go b/health/health.go index 314107cfa..01c79dd65 100644 --- a/health/health.go +++ b/health/health.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "os" + "runtime" "sort" "sync" "sync/atomic" @@ -347,6 +348,12 @@ var ( receiveFuncs = []*ReceiveFuncStats{&ReceiveIPv4, &ReceiveIPv6, &ReceiveDERP} ) +func init() { + if runtime.GOOS == "js" { + receiveFuncs = receiveFuncs[2:] // ignore IPv4 and IPv6 + } +} + // ReceiveFuncStats tracks the calls made to a wireguard-go receive func. type ReceiveFuncStats struct { // name is the name of the receive func.