Documentation
¶
Overview ¶
Package util provides shared utility functions used across the skill-validator codebase: number formatting, pluralization, rounding, sorted-key extraction, and ANSI color helpers.
Index ¶
Constants ¶
View Source
const ( // ColorReset disables all ANSI text attributes. ColorReset = "\033[0m" // ColorBold enables bold text. ColorBold = "\033[1m" // ColorRed sets the text color to red. ColorRed = "\033[31m" // ColorGreen sets the text color to green. ColorGreen = "\033[32m" // ColorYellow sets the text color to yellow. ColorYellow = "\033[33m" // ColorCyan sets the text color to cyan. ColorCyan = "\033[36m" )
Variables ¶
View Source
var CodeBlockPattern = regexp.MustCompile("(?s)(?:```|~~~)[\\w]*\\n(.*?)(?:```|~~~)")
CodeBlockPattern extracts fenced code block bodies (capture group 1) from markdown.
View Source
var CodeBlockStrip = regexp.MustCompile("(?s)(?:```|~~~)[\\w]*\\n.*?(?:```|~~~)")
CodeBlockStrip removes fenced code blocks (backtick and tilde) from markdown.
View Source
var InlineCodeStrip = regexp.MustCompile("`[^`]+`")
InlineCodeStrip removes inline code spans from markdown.
Functions ¶
func FormatNumber ¶
FormatNumber formats an integer with thousand-separator commas.
func SkillNameFromDir ¶
SkillNameFromDir derives a skill name from a directory path.
func SortedKeys ¶
SortedKeys returns the keys of any map[string]V sorted alphabetically.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.