fix: linting

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
pull/645/head
Henrique Dias 2019-01-23 15:58:06 +00:00
parent 2ba176a319
commit b90d39dfda
1 changed files with 3 additions and 3 deletions

View File

@ -89,11 +89,11 @@ func (s *Storage) Save(user *User) error {
// id must be a string for username lookup or a uint for id lookup. If id // id must be a string for username lookup or a uint for id lookup. If id
// is neither, a ErrInvalidDataType will be returned. // is neither, a ErrInvalidDataType will be returned.
func (s *Storage) Delete(id interface{}) (err error) { func (s *Storage) Delete(id interface{}) (err error) {
switch id.(type) { switch id := id.(type) {
case string: case string:
err = s.back.DeleteByUsername(id.(string)) err = s.back.DeleteByUsername(id)
case uint: case uint:
err = s.back.DeleteByID(id.(uint)) err = s.back.DeleteByID(id)
default: default:
err = errors.ErrInvalidDataType err = errors.ErrInvalidDataType
} }