Skip to content

Expand Go slop pattern coverage #4

@avifenesh

Description

@avifenesh

Context

Go currently has only 2 language-specific patterns (placeholder_panic_go, empty_catch_js partially). For a language this common in the AI tooling ecosystem, coverage is far too thin.

Patterns to add

Debugging

  • fmt.Println / fmt.Printf debugging statements (not in test files)
  • log.Println / log.Printf left from debugging (context-dependent)
  • spew.Dump / pp.Println debug pretty-printers

Placeholders

  • // TODO: implement with empty function body
  • Functions returning only zero values with a TODO comment

Error handling

  • if err != nil { } - empty error check blocks
  • _ = someFunc() - explicitly discarded errors (outside known-safe cases)

Code smells

  • interface{} / any overuse in function signatures (heuristic)
  • Bare os.Exit() outside main

Implementation

  • Add patterns to slop-patterns.js with language: 'go'
  • Add .go multi-pass support in slop-analyzers.js (COMMENT_SYNTAX, EXPORT_PATTERNS already exist)
  • Add golangci-lint integration in Phase 2 (cli-enhancers.js - scaffold exists but needs patterns)

Acceptance

  • 8+ Go-specific patterns
  • Tests for each pattern (true positive + false positive cases)
  • npm test passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions