Staticcheck (#464)

Using `go get -u honnef.co/go/tools/cmd/staticcheck`
Uneaarthed a couple of real bugs
This commit is contained in:
Raja Subramanian
2022-02-25 12:04:08 +05:30
committed by GitHub
parent 5a4181b581
commit 0170cc1cb6
19 changed files with 32 additions and 41 deletions
+2 -2
View File
@@ -139,7 +139,7 @@ func (s *RedisStore) LockRoom(_ context.Context, name livekit.RoomName, duration
}
// stop waiting past lock duration
if time.Now().Sub(startTime) > duration {
if time.Since(startTime) > duration {
break
}
@@ -282,7 +282,7 @@ func (s *RedisStore) ListEgress(_ context.Context, roomID livekit.RoomID) ([]*li
return nil, err
}
data, err := s.rc.HMGet(s.ctx, EgressKey, ids...).Result()
data, _ := s.rc.HMGet(s.ctx, EgressKey, ids...).Result()
for _, d := range data {
if d == nil {
continue