stringPtr converts a pointer of string-derived type to pointer of string. Returns nil if the input pointer is nil.
(ptr *strPtrType)
| 369 | // stringPtr converts a pointer of string-derived type to pointer of string. |
| 370 | // Returns nil if the input pointer is nil. |
| 371 | func stringPtr[strPtrType ~string](ptr *strPtrType) *string { |
| 372 | if ptr == nil { |
| 373 | return nil |
| 374 | } |
| 375 | s := string(*ptr) |
| 376 | return &s |
| 377 | } |
| 378 | |
| 379 | func parseFlexibleDate(input string) (string, error) { |
| 380 | now := time.Now().UTC() |
no outgoing calls