package social import ( "fmt" "strings" ) func isEmailAllowed(email string, allowedDomains []string) bool { if len(allowedDomains) == 0 { return true } valid := false for _, domain := range allowedDomains { emailSuffix := fmt.Sprintf("@%s", domain) valid = valid || strings.HasSuffix(email, emailSuffix) } return valid }