fix(ci): lint clean — %w wrapping in VerifyDescriptor + nilerr in proxyRelayConnections

- portal/discovery/sign.go: errorlint flagged three fmt.Errorf calls that used %v for wrapped errors after a leading %w. Switched to multi-%w (Go 1.20+) so callers can errors.Is both the sentinel and the underlying cause. - cmd/portal-tunnel/relays.go: nilerr flagged the accept-loop returning nil when ctx.Err() != nil — the err value was discarded. Reordered the switch so only context.Canceled returns nil (documented shutdown), other ctx errors surface via ctx.Err(). Note: golangci-lint pre-commit hook SKIPped — its isolated toolchain pins go 1.26.1 but go.mod requires 1.26.2 (environment drift). Verified locally with go 1.26.2 + golangci-lint 2.11.4: 0 issues across all CI-targeted packages. CI will re-run the check with the correct toolchain.

cognitive committed Apr 13, 2026 at 16:36 UTC 75e904bc39a0863d80f28b6787c2c7c77e4e42a0
2 files changed +6 -4
cmd/portal-tunnel/relays.go
+3 -1
@@ -108,8 +108,10 @@ func proxyRelayConnections(ctx context.Context, exposure *sdk.Exposure, localAdd
108 relayConn, err := exposure.Accept()
109 if err != nil {
110 switch {
111 - case ctx.Err() != nil || errors.Is(err, context.Canceled):
111 + case errors.Is(err, context.Canceled):
112 return nil
113 + case ctx.Err() != nil:
114 + return ctx.Err()
115 case errors.Is(err, net.ErrClosed):
116 return errors.New("all relay listeners stopped")
117 default:
portal/discovery/sign.go
+3 -3
@@ -90,7 +90,7 @@ func VerifyDescriptor(desc types.RelayDescriptor) (publicKeyHex string, err erro
90
91 signature, err := base64.StdEncoding.DecodeString(rawSignature)
92 if err != nil {
93 - return "", fmt.Errorf("%w: base64 decode: %v", ErrDescriptorInvalidSignature, err)
93 + return "", fmt.Errorf("%w: base64 decode: %w", ErrDescriptorInvalidSignature, err)
94 }
95 if len(signature) != descriptorSignatureSize {
96 return "", fmt.Errorf("%w: unexpected signature length %d", ErrDescriptorInvalidSignature, len(signature))
@@ -104,7 +104,7 @@ func VerifyDescriptor(desc types.RelayDescriptor) (publicKeyHex string, err erro
104 unsignedCopy.Signature = ""
105 normalized, err := utils.NormalizeDescriptor(unsignedCopy)
106 if err != nil {
107 - return "", fmt.Errorf("%w: normalize: %v", ErrDescriptorInvalidSignature, err)
107 + return "", fmt.Errorf("%w: normalize: %w", ErrDescriptorInvalidSignature, err)
108 }
109 if strings.TrimSpace(normalized.Address) == "" {
110 return "", ErrDescriptorMissingAddress
@@ -117,7 +117,7 @@ func VerifyDescriptor(desc types.RelayDescriptor) (publicKeyHex string, err erro
117
118 publicKey, _, err := ecdsa.RecoverCompact(signature, digest[:])
119 if err != nil {
120 - return "", fmt.Errorf("%w: %v", ErrDescriptorInvalidSignature, err)
120 + return "", fmt.Errorf("%w: %w", ErrDescriptorInvalidSignature, err)
121 }
122 if publicKey == nil {
123 return "", ErrDescriptorInvalidSignature