NormalizedStringPointer trims a string pointer and returns nil for nil or empty values.
(value *string)
| 5 | // NormalizedStringPointer trims a string pointer and returns nil for nil or |
| 6 | // empty values. |
| 7 | func NormalizedStringPointer(value *string) *string { |
| 8 | if value == nil { |
| 9 | return nil |
| 10 | } |
| 11 | trimmed := strings.TrimSpace(*value) |
| 12 | if trimmed == "" { |
| 13 | return nil |
| 14 | } |
| 15 | return &trimmed |
| 16 | } |
| 17 | |
| 18 | // NormalizedEnumValue returns the canonical allowed value matching value after |
| 19 | // case normalization, or nil when no value matches. |
no outgoing calls