(sessions map[string]*session)
| 543 | } |
| 544 | |
| 545 | func newTestServer(sessions map[string]*session) *Server { |
| 546 | if sessions == nil { |
| 547 | sessions = map[string]*session{} |
| 548 | } |
| 549 | now := time.Now() |
| 550 | for _, currentSession := range sessions { |
| 551 | if currentSession.createdAt.IsZero() { |
| 552 | currentSession.createdAt = now |
| 553 | } |
| 554 | if currentSession.lastUsedAt.IsZero() { |
| 555 | currentSession.lastUsedAt = now |
| 556 | } |
| 557 | } |
| 558 | return &Server{sessions: sessions} |
| 559 | } |
| 560 | |
| 561 | func countSessionsForUser(srv *Server, userID uint) int { |
| 562 | count := 0 |
no test coverage detected