textutil

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package textutil holds small, model-independent string and collection helpers shared by the generators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUnique

func AppendUnique(in []string, x string) []string

AppendUnique appends the trimmed x to in unless it is blank or already present. It may share in's backing array. TRLC-LINKS: REQ-EMG-010

func AppendUniqueSlice

func AppendUniqueSlice(in []string, items []string) []string

AppendUniqueSlice returns a copy of in with each item appended by AppendUnique. TRLC-LINKS: REQ-EMG-010

func CollapseSpace added in v0.8.0

func CollapseSpace(s string) string

CollapseSpace collapses every run of whitespace to one space and trims both ends; case and every other character are kept. TRLC-LINKS: REQ-EMG-095

func DeterministicUUID

func DeterministicUUID(seed string) string

DeterministicUUID derives a version-5-style UUID string from the SHA-1 of seed. TRLC-LINKS: REQ-EMG-013 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func Fallback

func Fallback(s, def string) string

Fallback returns s unless it is blank (whitespace only), then def. TRLC-LINKS: REQ-EMG-015 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func NonEmpty

func NonEmpty(v, fallback string) string

NonEmpty returns v unless it is blank (whitespace only), then fallback. v is returned untrimmed. TRLC-LINKS: REQ-EMG-003

func SortedKeys

func SortedKeys[V any](m map[string]V) []string

SortedKeys returns map keys in deterministic order (used by serialization helpers). TRLC-LINKS: REQ-EMG-015 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func UniqueSorted

func UniqueSorted(in []string) []string

UniqueSorted trims each value, drops blanks and duplicates and returns the rest sorted. The result is never nil. TRLC-LINKS: REQ-EMG-003

Types

This section is empty.

Jump to

Keyboard shortcuts

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