From 84fac19f98f159a6f77fea2e1776f003c7d863ab Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Wed, 29 Apr 2026 19:00:05 +0000 Subject: [PATCH] fix(scep-probe): satisfy staticcheck QF1008 in describeCertAlgorithm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI flagged QF1008 on the chained selector pub.Curve.Params() — the linter wants the promoted-method form pub.Params() (Curve is embedded in ecdsa.PublicKey, so Params is reachable via promotion). Restructure the nil check so the embedded interface still gets validated before the promoted call, then invoke pub.Params() once and reuse the result. Verification: * gofmt clean * staticcheck on internal/service/...: clean * 6/6 TestProbeSCEP_* tests still pass --- internal/service/scep_probe.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/service/scep_probe.go b/internal/service/scep_probe.go index ec2ddd8..834a946 100644 --- a/internal/service/scep_probe.go +++ b/internal/service/scep_probe.go @@ -322,8 +322,15 @@ func describeCertAlgorithm(c *x509.Certificate) string { case *rsa.PublicKey: return fmt.Sprintf("RSA-%d", pub.N.BitLen()) case *ecdsa.PublicKey: - if pub.Curve != nil && pub.Curve.Params() != nil { - return "ECDSA-" + pub.Curve.Params().Name + // Curve is embedded in ecdsa.PublicKey; check the interface + // itself for nil before calling Params() via promotion (QF1008 + // — staticcheck wants the promoted-method form, not the + // chained selector). Still need the nil check because + // calling Params() on a nil embedded interface would panic. + if pub.Curve != nil { + if params := pub.Params(); params != nil { + return "ECDSA-" + params.Name + } } return "ECDSA" }