all: apply golangci-lint 2.9.0 fixes

Fix issues found by the upgraded golangci-lint:
- wsl_v5: add required whitespace in CLI files
- staticcheck SA4006: replace new(var.Field) with &localVar
  pattern since staticcheck does not recognize Go 1.26
  new(value) as a use of the variable
- staticcheck SA5011: use t.Fatal instead of t.Error for
  nil guard checks so execution stops
- unused: remove dead ptrTo helper function
This commit is contained in:
Kristoffer Dalby 2026-02-16 19:40:02 +00:00
parent 73613d7f53
commit 43afeedde2
15 changed files with 58 additions and 24 deletions

View file

@ -330,6 +330,8 @@ func TestApproveRoutesWithPolicy_NilPolicyManagerCase(t *testing.T) {
Name: "test",
}
userID := user.ID
currentApproved := []netip.Prefix{
netip.MustParsePrefix("10.0.0.0/24"),
}
@ -342,8 +344,8 @@ func TestApproveRoutesWithPolicy_NilPolicyManagerCase(t *testing.T) {
MachineKey: key.NewMachine().Public(),
NodeKey: key.NewNode().Public(),
Hostname: "testnode",
UserID: new(user.ID),
User: new(user),
UserID: &userID,
User: &user,
RegisterMethod: util.RegisterMethodAuthKey,
Hostinfo: &tailcfg.Hostinfo{
RoutableIPs: announcedRoutes,