tools

package
v0.7.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tools provides general utility functions used across the application. This includes helpers for file I/O, Markdown generation, and other common tasks that don't fit into more specific domain packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFencedCodeBlock

func AppendFencedCodeBlock(buf *bytes.Buffer, content string, languageHint string)

AppendFencedCodeBlock adds a standard Markdown fenced code block to the buffer.

func AppendFileMarkerFooter

func AppendFileMarkerFooter(buf *bytes.Buffer, filePath string)

AppendFileMarkerFooter adds the explicit file end marker.

func AppendFileMarkerHeader

func AppendFileMarkerHeader(buf *bytes.Buffer, filePath string)

AppendFileMarkerHeader adds the explicit file start marker.

func AppendSectionHeader

func AppendSectionHeader(buf *bytes.Buffer, title string)

AppendSectionHeader adds a standard Markdown H3 section header to the buffer.

func ReadFileContent

func ReadFileContent(filePath string) ([]byte, error)

ReadFileContent reads the entire content of the file at the specified path. Returns the content as a byte slice or an error if reading fails.

func WriteBufferToFile

func WriteBufferToFile(filePath string, buf *bytes.Buffer) error

WriteBufferToFile writes the content of a bytes.Buffer to the specified file path. It uses default file permissions (0600). It prints informational messages about writing to os.Stdout. TODO: Refactor to remove direct fmt.Printf calls.

Calling commands should use their Presenter for user-facing messages
or a Logger for debug/trace information related to file writing.
This function should focus solely on writing the file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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