Use fmt.Errorf

This commit is contained in:
nemunaire 2020-04-15 07:39:38 +02:00
parent 45069d4fbb
commit adb424ea03
11 changed files with 50 additions and 60 deletions

View file

@ -210,7 +210,7 @@ func (k FlagKey) AddDepend(j Flag) (err error) {
} else if d, ok := j.(MCQ); ok {
_, err = DBExec("INSERT INTO exercice_flags_omcq_deps (id_flag, id_mcq_dep) VALUES (?, ?)", k.Id, d.Id)
} else {
err = errors.New(fmt.Sprintf("Dependancy type for key (%T) not implemented for this flag.", j))
err = fmt.Errorf("Dependancy type for key (%T) not implemented for this flag.", j)
}
return
}