mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-03 16:24:04 +00:00
Some code improvements
* Rewrite empty string checks more idiomatically. * Change strings.ToLower comparisons to strings.EqualFold. * Rewrite switch statement with only one case as if.
This commit is contained in:
1 parent
4c93d36d49
commit
0401a91ef4
26 files changed
+38
-39
No files matched your search
@@ -167,7 +167,7 @@ func (h *Handler) AddUser(ctx context.Context, user *protocol.MemoryUser) error
|
||||
}
|
||||
|
||||
func (h *Handler) RemoveUser(ctx context.Context, email string) error {
|
||||
if len(email) == 0 {
|
||||
if email == "" {
|
||||
return newError("Email must not be empty.")
|
||||
}
|
||||
if !h.usersByEmail.Remove(email) {
|
||||
|
||||
Reference in new issue
Block a user