fix: linting
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
Former-commit-id: 3b1344ed7b9b7c41f7188a3e740cf69f3de7ebb7 [formerly db8acf75870cd31f5077629b2f8bcc6606afb606] [formerly e2a38027b43f835c13933188d0c4e14119f78661 [formerly b90d39dfda
]]
Former-commit-id: c521ed975cc868b106344c4212707aa1b1eae19d [formerly a3f0dace392521435350c78e40adfc9ac6c576f2]
Former-commit-id: 46c88075964cdd102f5fd2c12e1b09fd94eba6b1
pull/726/head
parent
552f8168ea
commit
007fde8186
|
@ -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
|
||||
// is neither, a ErrInvalidDataType will be returned.
|
||||
func (s *Storage) Delete(id interface{}) (err error) {
|
||||
switch id.(type) {
|
||||
switch id := id.(type) {
|
||||
case string:
|
||||
err = s.back.DeleteByUsername(id.(string))
|
||||
err = s.back.DeleteByUsername(id)
|
||||
case uint:
|
||||
err = s.back.DeleteByID(id.(uint))
|
||||
err = s.back.DeleteByID(id)
|
||||
default:
|
||||
err = errors.ErrInvalidDataType
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue