fix: resolve staticcheck warnings

- Remove empty if branches in ring_packing_test.go (SA9003)
- Remove unused ringP field in dag/executor.go (U1000)
- Lowercase error strings in dag/executor.go (ST1005)
This commit is contained in:
2026-02-05 15:41:54 -08:00
parent 2602685293
commit 314a2061c9
2 changed files with 6 additions and 11 deletions
+2 -6
View File
@@ -319,9 +319,7 @@ func testRingPacking(tc *TestContext, t *testing.T) {
t.Run(testString(params, params.MaxLevelQ(), params.MaxLevelP(), 0, "Repack"), func(t *testing.T) {
if params.RingType() != ring.Standard {
// Test all ring types - removed skip for ConjugateInvariant
}
// Note: Test runs for all ring types including ConjugateInvariant
t.Parallel()
pt := NewPlaintext(params, level)
@@ -392,9 +390,7 @@ func testRingPacking(tc *TestContext, t *testing.T) {
}
func testExtractPermuteRepack(params Parameters, level int, enc *Encryptor, dec *Decryptor, eval *RingPackingEvaluator, ExtractNaive, RepackNaive bool, t *testing.T) {
if params.RingType() != ring.Standard {
// Test all ring types - removed skip for ConjugateInvariant
}
// Note: Test runs for all ring types including ConjugateInvariant
ringQ := params.RingQ().AtLevel(level)
+4 -5
View File
@@ -89,9 +89,8 @@ type ExecutionContext struct {
gpuCtx any // Will be *gpu.NTTContext when GPU is available
// Ring parameters
ringQ *ring.Ring
ringP *ring.Ring // May be nil
degree int
ringQ *ring.Ring
degree int
maxLevel int
// Statistics
@@ -260,7 +259,7 @@ func (e *Executor) registerDefaultOps() {
// Negate operation
e.ops[OpNegate] = func(ctx *ExecutionContext, node *Node, level int) error {
if len(node.Inputs) != 1 {
return fmt.Errorf("Negate requires 1 input, got %d", len(node.Inputs))
return fmt.Errorf("negate requires 1 input, got %d", len(node.Inputs))
}
in, ok := ctx.GetCiphertext(CiphertextID(node.Inputs[0]))
@@ -329,7 +328,7 @@ func (e *Executor) registerDefaultOps() {
// Copy operation
e.ops[OpCopy] = func(ctx *ExecutionContext, node *Node, level int) error {
if len(node.Inputs) != 1 {
return fmt.Errorf("Copy requires 1 input, got %d", len(node.Inputs))
return fmt.Errorf("copy requires 1 input, got %d", len(node.Inputs))
}
in, ok := ctx.GetCiphertext(CiphertextID(node.Inputs[0]))