ussd/internal/utils/name.go

18 lines
335 B
Go
Raw Permalink Normal View History

package utils
func ConstructName(firstName, familyName, defaultValue string) string {
2024-12-03 12:12:47 +01:00
name := defaultValue
if familyName != defaultValue {
if firstName != defaultValue {
name = firstName + " " + familyName
} else {
name = familyName
}
} else {
if firstName != defaultValue {
name = firstName
}
}
return name
}