Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Jul 17, 2024
1 parent 96c0585 commit b045b10
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
14 changes: 0 additions & 14 deletions common/configuration/asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ func (a *ASM) SyncInterval() time.Duration {
}

func (a *ASM) Sync(ctx context.Context, entries []Entry, values *xsync.MapOf[Ref, SyncedValue]) error {
refs := []Ref{}
values.Range(func(key Ref, value SyncedValue) bool {
refs = append(refs, key)
return true
})

c, _ := a.coordinator.Get()
fmt.Printf("before %T sync: %v\n", c, refs)
client, err := a.coordinator.Get()
if err != nil {
return fmt.Errorf("could not coordinate ASM: %w", err)
Expand All @@ -109,12 +101,6 @@ func (a *ASM) Sync(ctx context.Context, entries []Entry, values *xsync.MapOf[Ref
if err != nil {
return fmt.Errorf("%s: %w", client.name(), err)
}
refs = []Ref{}
values.Range(func(key Ref, value SyncedValue) bool {
refs = append(refs, key)
return true
})
fmt.Printf("after %T sync: %v\n", c, refs)
return nil
}

Expand Down
3 changes: 0 additions & 3 deletions common/configuration/asm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@ func waitForManualSync[R Role](t *testing.T, providers []*ManualSyncProvider[R])

for _, provider := range providers {
err := provider.SyncAndWait()
if err != nil {
fmt.Printf("aaa\n")
}
assert.NoError(t, err)
}
}
Expand Down
1 change: 0 additions & 1 deletion common/configuration/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ func (c *cache[R]) sync(ctx context.Context) {
providersToSync := []*cacheProvider[R]{}
for _, cp := range c.providers {
if cp.needsSync() {
fmt.Print("needs sync!\n")
providersToSync = append(providersToSync, cp)
}
}
Expand Down
8 changes: 4 additions & 4 deletions common/configuration/manual_sync_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (a *ManualSyncProvider[R]) SyncAndWait() error {
a.syncRequested.Store(optional.Some(block))
err := <-block.sync
if err, hasErr := err.Get(); hasErr {
return err
return err //nolint:wrapcheck
}
return nil
}
Expand All @@ -55,11 +55,11 @@ func (a *ManualSyncProvider[R]) Key() string {
}

func (a *ManualSyncProvider[R]) Store(ctx context.Context, ref Ref, value []byte) (*url.URL, error) {
return a.provider.Store(ctx, ref, value)
return a.provider.Store(ctx, ref, value) //nolint:wrapcheck
}

func (a *ManualSyncProvider[R]) Delete(ctx context.Context, ref Ref) error {
return a.provider.Delete(ctx, ref)
return a.provider.Delete(ctx, ref) //nolint:wrapcheck
}

func (a *ManualSyncProvider[R]) SyncInterval() time.Duration {
Expand All @@ -82,5 +82,5 @@ func (a *ManualSyncProvider[R]) Sync(ctx context.Context, entries []Entry, value
block.sync <- optional.Some(err)
}
}
return err
return err //nolint:wrapcheck
}

0 comments on commit b045b10

Please sign in to comment.