Use pointer instead of struct
This commit is contained in:
parent
853477e54a
commit
6d8f38d749
18 changed files with 187 additions and 142 deletions
|
|
@ -338,7 +338,7 @@ func receiveChallenge(r *http.Request, ps httprouter.Params, body []byte) (inter
|
|||
return nil, errors.New("This is not the expected token.")
|
||||
}
|
||||
|
||||
var std adlin.Student
|
||||
var std *adlin.Student
|
||||
|
||||
if stdid, err := strconv.Atoi(gt.Login); err == nil {
|
||||
if std, err = adlin.GetStudent(stdid); err != nil {
|
||||
|
|
@ -388,7 +388,7 @@ func receiveToken(r *http.Request, body []byte, chid int) (interface{}, error) {
|
|||
if std, err := adlin.GetStudentByLogin(gt.Login); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
if err := challenges[chid-1].Check(&std, >, chid); err != nil {
|
||||
if err := challenges[chid-1].Check(std, >, chid); err != nil {
|
||||
log.Printf("%s just try ch#%d: %s\n", std.Login, chid, err)
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue