From 83ea88a3ab1892b1b87f66ad0a247a72f9a9a449 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 4 Nov 2022 03:03:31 +0300 Subject: [PATCH] add func find session by id --- sessionUtils/sessionUtils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sessionUtils/sessionUtils.go b/sessionUtils/sessionUtils.go index 0736ec3..99639c4 100644 --- a/sessionUtils/sessionUtils.go +++ b/sessionUtils/sessionUtils.go @@ -34,3 +34,13 @@ var FakeSessions = Sessions{ }, }, } + +func FindSessionByID(sessionId string, sessions []Session) Session { + for _, session := range sessions { + if session.SessionId == sessionId { + return session + } + } + var temp Session = Session{} + return temp +}