package adlin import ( "fmt" "strings" ) const ( AssociatedDomainSuffix = "adlin2021.p0m.fr." DelegatedDomainSuffix = "srs.p0m.fr." ) func (student Student) MyDelegatedDomain() string { return fmt.Sprintf("%s.%s", strings.Trim(strings.Replace(student.Login, "_", "-", -1), "-_"), DelegatedDomainSuffix) } func (student Student) MyAssociatedDomain() string { return fmt.Sprintf("%s.%s", strings.Trim(strings.Replace(student.Login, "_", "-", -1), "-_"), AssociatedDomainSuffix) } func (student Student) GetAssociatedDomains() (ds []string) { studentDomain := student.MyAssociatedDomain() ds = append(ds, studentDomain) return }