From f41bceda83457a8220a016fd55a465f63858ab50 Mon Sep 17 00:00:00 2001 From: Todd Knight Date: Fri, 12 Nov 2021 08:57:10 -0700 Subject: [PATCH] Merge from main and `make gen` --- internal/db/read_writer.go | 4 ++-- internal/host/plugin/repository_host_set.go | 2 +- .../host/plugin/repository_host_set_test.go | 18 +++++++++--------- internal/servers/controller/interceptor.go | 1 - 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/internal/db/read_writer.go b/internal/db/read_writer.go index 37c8592cb..338339a68 100644 --- a/internal/db/read_writer.go +++ b/internal/db/read_writer.go @@ -621,8 +621,8 @@ func (rw *Db) Update(ctx context.Context, i interface{}, fieldMaskPaths []string // Delete an object in the db with options: WithOplog, NewOplogMsg, WithWhere. // WithOplog will write an oplog entry for the delete. NewOplogMsg will return // in-memory oplog message. WithOplog and NewOplogMsg cannot be used together. -//WithWhere allows specifying an additional constraint on the operation in -//addition to the PKs. Delete returns the number of rows deleted and any errors. +// WithWhere allows specifying an additional constraint on the operation in +// addition to the PKs. Delete returns the number of rows deleted and any errors. func (rw *Db) Delete(ctx context.Context, i interface{}, opt ...Option) (int, error) { const op = "db.Delete" if rw.underlying == nil { diff --git a/internal/host/plugin/repository_host_set.go b/internal/host/plugin/repository_host_set.go index 40988766e..69f3aef04 100644 --- a/internal/host/plugin/repository_host_set.go +++ b/internal/host/plugin/repository_host_set.go @@ -359,7 +359,7 @@ func (r *Repository) UpdateSet(ctx context.Context, scopeId string, s *HostSet, db.ExpBackoff{}, func(reader db.Reader, w db.Writer) error { returnedSet = newSet.clone() - msgs := make([]*oplog.Message, 0, len(preferredEndpoints) + len(currentSet.PreferredEndpoints) + 2) + msgs := make([]*oplog.Message, 0, len(preferredEndpoints)+len(currentSet.PreferredEndpoints)+2) ticket, err := w.GetTicket(s) if err != nil { return errors.Wrap(ctx, err, op, errors.WithMsg("unable to get ticket")) diff --git a/internal/host/plugin/repository_host_set_test.go b/internal/host/plugin/repository_host_set_test.go index 6c1ce6302..62206535a 100644 --- a/internal/host/plugin/repository_host_set_test.go +++ b/internal/host/plugin/repository_host_set_test.go @@ -655,16 +655,16 @@ func TestRepository_UpdateSet(t *testing.T) { } tests := []struct { - name string - withScopeId *string - withEmptyPluginMap bool - withPluginError error - changeFuncs []changeHostSetFunc - version uint32 - fieldMask []string - wantCheckSetFuncs []checkHostSetFunc + name string + withScopeId *string + withEmptyPluginMap bool + withPluginError error + changeFuncs []changeHostSetFunc + version uint32 + fieldMask []string + wantCheckSetFuncs []checkHostSetFunc wantCheckPluginReqFuncs []checkPluginReqFunc - wantIsErr errors.Code + wantIsErr errors.Code }{ { name: "nil set", diff --git a/internal/servers/controller/interceptor.go b/internal/servers/controller/interceptor.go index 2f741f8b1..5eec995fb 100644 --- a/internal/servers/controller/interceptor.go +++ b/internal/servers/controller/interceptor.go @@ -274,7 +274,6 @@ func workerRequestInfoInterceptor(ctx context.Context, eventer *event.Eventer) ( const op = "worker.requestInfoInterceptor" if eventer == nil { return nil, errors.New(ctx, errors.InvalidParameter, op, "missing eventer") - } return func(interceptorCtx context.Context, req interface{},