From 156cd53e7734407dc42e30af2f12cf6956cd9e24 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 24 Mar 2025 10:15:37 -0700 Subject: [PATCH] net/netmon: unexport GetState Baby step towards #15408. Updates #15408 Change-Id: I11fca6e677af2ad2f065d83aa0d83550143bff29 Signed-off-by: Brad Fitzpatrick --- net/netmon/interfaces_test.go | 2 +- net/netmon/netmon.go | 2 +- net/netmon/state.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/netmon/interfaces_test.go b/net/netmon/interfaces_test.go index edd4f6d6e..5fec274ca 100644 --- a/net/netmon/interfaces_test.go +++ b/net/netmon/interfaces_test.go @@ -13,7 +13,7 @@ import ( ) func TestGetState(t *testing.T) { - st, err := GetState() + st, err := getState() if err != nil { t.Fatal(err) } diff --git a/net/netmon/netmon.go b/net/netmon/netmon.go index 47b540d6a..b58356d33 100644 --- a/net/netmon/netmon.go +++ b/net/netmon/netmon.go @@ -161,7 +161,7 @@ func (m *Monitor) InterfaceState() *State { } func (m *Monitor) interfaceStateUncached() (*State, error) { - return GetState() + return getState() } // SetTailscaleInterfaceName sets the name of the Tailscale interface. For diff --git a/net/netmon/state.go b/net/netmon/state.go index a612dd06d..b6a6b2ab8 100644 --- a/net/netmon/state.go +++ b/net/netmon/state.go @@ -466,7 +466,7 @@ var getPAC func() string // It does not set the returned State.IsExpensive. The caller can populate that. // // Deprecated: use netmon.Monitor.InterfaceState instead. -func GetState() (*State, error) { +func getState() (*State, error) { s := &State{ InterfaceIPs: make(map[string][]netip.Prefix), Interface: make(map[string]Interface),