net/netcheck: fix race condition initializting RegionLatency maps.
Under some conditions, code would try to look things up in the maps before the first call to updateLatency. I don't see any reason to delay initialization of the maps, so let's just init them right away when creating the Report instance. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
@ -96,7 +96,7 @@ func TestWorksWhenUDPBlocked(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
want := new(Report)
|
||||
want := newReport()
|
||||
|
||||
if !reflect.DeepEqual(r, want) {
|
||||
t.Errorf("mismatch\n got: %+v\nwant: %+v\n", r, want)
|
||||
|
Reference in New Issue
Block a user