add user clear

This commit is contained in:
fancl 2024-02-27 09:46:46 +08:00
parent 634261a27c
commit 0cd890fbb0
1 changed files with 9 additions and 0 deletions

View File

@ -19,3 +19,12 @@ func (ui *Userinfo) Get(k string) string {
}
return ui.variables[k]
}
func (ui *Userinfo) Reset(id, name string) {
ui.ID = id
ui.Name = name
// clear the variables
for k, _ := range ui.variables {
delete(ui.variables, k)
}
}