login-validator: Refactor, search csv in /data dir

This commit is contained in:
nemunaire 2023-02-25 14:42:40 +01:00
commit 50ad1f0712
4 changed files with 16 additions and 12 deletions

View file

@ -26,15 +26,13 @@ func readStudentsList(studentsFile string) (stds []Student, err error) {
return nil, err
} else {
for _, i := range list {
var s Student
s.Lastname = i[0]
s.Firstname = i[1]
s.Login = i[2]
s.EMail = i[3]
s.Phone = i[4]
stds = append(stds, s)
stds = append(stds, Student{
Lastname: i[0],
Firstname: i[1],
Login: i[2],
EMail: i[3],
Phone: i[4],
})
}
return stds, nil