Taking a bunch of go modernize suggestions. (#4194)
This is not all of it as it is not possible (or at least I do not know of a way) to get all suggestions for a repo/project. Did this via loop searching mainly and taking the modernize suggestions.
This commit is contained in:
@@ -600,7 +600,7 @@ func (s *RedisStore) storeIngress(_ context.Context, info *livekit.IngressInfo)
|
||||
}
|
||||
|
||||
// Retry if the key has been changed.
|
||||
for i := 0; i < maxRetries; i++ {
|
||||
for range maxRetries {
|
||||
err := s.rc.Watch(s.ctx, txf, IngressKey)
|
||||
switch err {
|
||||
case redis.TxFailedErr:
|
||||
@@ -675,7 +675,7 @@ func (s *RedisStore) storeIngressState(_ context.Context, ingressId string, stat
|
||||
}
|
||||
|
||||
// Retry if the key has been changed.
|
||||
for i := 0; i < maxRetries; i++ {
|
||||
for range maxRetries {
|
||||
err := s.rc.Watch(s.ctx, txf, IngressStatePrefix+ingressId)
|
||||
switch err {
|
||||
case redis.TxFailedErr:
|
||||
|
||||
@@ -320,7 +320,7 @@ func testIter[T listItem](
|
||||
) {
|
||||
ctx := context.Background()
|
||||
var all []string
|
||||
for i := 0; i < 250; i++ {
|
||||
for i := range 250 {
|
||||
id := fmt.Sprintf("%05d", i)
|
||||
all = append(all, id)
|
||||
err := create(ctx, id)
|
||||
|
||||
Reference in New Issue
Block a user