srclines

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package srclines is the shared source-file line cache used by every stage that re-reads scanned source to show or match lines: the HTML report's code snippets, the LLM reviewer's code context, and the inline godzilla:ignore sweep.

A Cache is deliberately pass-scoped (one per report render / review pass / ignore sweep), never package-global, so a later scan of a changed file can never observe stale contents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache map[string][]string

Cache memoizes source files split into lines. A nil entry records an unreadable file so it is not retried on later lookups. The zero value of the underlying map type is not usable; construct with Cache{}.

func (Cache) Lines

func (c Cache) Lines(filename string) ([]string, bool)

Lines returns filename's contents split on "\n", reading the file at most once per Cache. ok=false (with nil lines) when the file cannot be read; the failure is cached, so a missing file costs one failed read per pass, not one per lookup.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL