Skip to content

Commit

Permalink
πŸ› Fix: Reset d.Data instead of deleting keys in it (#2156)
Browse files Browse the repository at this point in the history
πŸ› Reset d.Data instead of deleting keys in it
  • Loading branch information
xbt573 authored Oct 17, 2022
1 parent f3c7c42 commit a023fc2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions middleware/session/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ func acquireData() *data {

func (d *data) Reset() {
d.Lock()
for key := range d.Data {
delete(d.Data, key)
}
d.Data = make(map[string]interface{})
d.Unlock()
}

Expand Down

0 comments on commit a023fc2

Please sign in to comment.