This look nicely done, thanks for sharing! On Tuesday, December 2, 2025 at 12:56:42 PM UTC+13 Mohamed Zane Attahri wrote:
> Hi all, > > I’d like to share *lines* (github.com/mzattahri/lines), a library for > reading, searching, and modifying text sources on a per-line basis. It uses > iterators and simple abstractions that make it ergonomic to traverse, > filter, rewrite, or transform text line by line. > > What it does: > > (a) Iterate over all lines (forward or backward), or head/tail subsets. > > (b) Search/filter lines by content or custom predicates. > > (c) Modify files in place (replace, remove, insert, truncate) or > rewrite/transform them safely using a buffered rewrite or streaming. > > (d) Maintain 1-based line numbering consistently (even when iterating > backwards or slicing). > > Why it might be useful: > > (1) For tooling that deals with text files (config files, logs, code, > data), where you often want to inspect or change specific lines without > rewriting the whole file manually. > > (2) For simple command-line utilities or small Go programs where full > AST-based parsing is overkill, but line-based scanning or editing is > sufficient. > > (3) When you prefer a straightforward API with minimal dependencies and > clear semantics around iteration and modification. > > Thoughts and feedback are welcome. > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/dededde0-479d-4f7d-8eef-c2a5db6ad854n%40googlegroups.com.
