mirror of
https://github.com/juanfont/headscale.git
synced 2026-03-31 22:43:31 +02:00
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:
@@ -929,8 +929,8 @@ func tagp(name string) policyv2.Alias {
|
||||
// prefixp returns a pointer to a Prefix from a CIDR string for policy v2 configurations.
|
||||
// Converts CIDR notation to policy prefix format for network range specifications.
|
||||
func prefixp(cidr string) policyv2.Alias {
|
||||
prefix := netip.MustParsePrefix(cidr)
|
||||
return new(policyv2.Prefix(prefix))
|
||||
p := policyv2.Prefix(netip.MustParsePrefix(cidr))
|
||||
return &p
|
||||
}
|
||||
|
||||
// aliasWithPorts creates an AliasWithPorts structure from an alias and port ranges.
|
||||
|
||||
Reference in New Issue
Block a user