transform

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package transform provides struct transformation utilities for mutating string fields recursively within structs. These utilities are commonly used inside [apivalidation.Normalizer] implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StructMulti

func StructMulti(v any, fns ...func(any))

StructMulti runs all given functions on the struct pointer sequentially.

func StructStringFunc

func StructStringFunc(v any, f func(string) string)

StructStringFunc applies f to every string field in the struct recursively.

func StructToLower

func StructToLower(v any)

StructToLower runs strings.ToLower on all string fields in the struct recursively.

func StructTrimSpace

func StructTrimSpace(v any)

StructTrimSpace runs strings.TrimSpace on all string fields in the struct recursively, including nested structs, pointer fields, slices, and map values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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