From b045b109d44d5766657d22eba05f19dd15def08e Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Wed, 17 Jul 2024 22:22:18 +1000 Subject: [PATCH] fix lint --- common/configuration/asm.go | 14 -------------- common/configuration/asm_test.go | 3 --- common/configuration/cache.go | 1 - common/configuration/manual_sync_utils.go | 8 ++++---- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/common/configuration/asm.go b/common/configuration/asm.go index c74266c1e8..74bf8826dd 100644 --- a/common/configuration/asm.go +++ b/common/configuration/asm.go @@ -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) @@ -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 } diff --git a/common/configuration/asm_test.go b/common/configuration/asm_test.go index 86c76c9a1f..489b9b0f01 100644 --- a/common/configuration/asm_test.go +++ b/common/configuration/asm_test.go @@ -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) } } diff --git a/common/configuration/cache.go b/common/configuration/cache.go index 12945d4186..8bfb5e6bf6 100644 --- a/common/configuration/cache.go +++ b/common/configuration/cache.go @@ -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) } } diff --git a/common/configuration/manual_sync_utils.go b/common/configuration/manual_sync_utils.go index 429f19f707..34acdce9a2 100644 --- a/common/configuration/manual_sync_utils.go +++ b/common/configuration/manual_sync_utils.go @@ -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 } @@ -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 { @@ -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 }