From 0cd890fbb0c47b893f4ebf6bb3a250fba8408d80 Mon Sep 17 00:00:00 2001 From: fancl Date: Tue, 27 Feb 2024 09:46:46 +0800 Subject: [PATCH] add user clear --- entry/http/user.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entry/http/user.go b/entry/http/user.go index 62e7984..ab97579 100644 --- a/entry/http/user.go +++ b/entry/http/user.go @@ -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) + } +}