Documentation
¶
Overview ¶
Package textutil holds small, model-independent string and collection helpers shared by the generators.
Index ¶
- func AppendUnique(in []string, x string) []string
- func AppendUniqueSlice(in []string, items []string) []string
- func DeterministicUUID(seed string) string
- func Fallback(s, def string) string
- func NonEmpty(v, fallback string) string
- func SortedKeys[V any](m map[string]V) []string
- func UniqueSorted(in []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendUnique ¶
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 ¶
AppendUniqueSlice returns a copy of in with each item appended by AppendUnique. TRLC-LINKS: REQ-EMG-010
func DeterministicUUID ¶
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 ¶
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 ¶
NonEmpty returns v unless it is blank (whitespace only), then fallback. v is returned untrimmed. TRLC-LINKS: REQ-EMG-003
func SortedKeys ¶
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 ¶
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.