Skip to content

Commit 69cf067

Browse files
authored
Re-anchor comments in server/server.go. (#243)
* Re-anchor comments in server/server.go. * Fix staticcheck errors regarding Print vs. Printf. * Add `RequiresIPv6` to tests per #244.
1 parent bc96b24 commit 69cf067

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

chk/chk.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func HasResult(t testing.TB, res []*client.OpResult, want *client.OpResult, opt
133133
for _, r := range res {
134134
buf.WriteString(fmt.Sprintf("\t%s\n", r))
135135
}
136-
t.Fatalf(buf.String())
136+
t.Fatal(buf.String())
137137
}
138138
}
139139

compliance/compliance.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,9 @@ var (
368368
},
369369
}, {
370370
In: Test{
371-
Fn: makeTestWithACK(GetIPv6, fluent.InstalledInRIB),
372-
ShortName: "Get for installed IPv6 Entry - RIB ACK",
371+
Fn: makeTestWithACK(GetIPv6, fluent.InstalledInRIB),
372+
ShortName: "Get for installed IPv6 Entry - RIB ACK",
373+
RequiresIPv6: true,
373374
},
374375
}, {
375376
In: Test{
@@ -404,6 +405,7 @@ var (
404405
Fn: makeTestWithACK(GetIPv6, fluent.InstalledInFIB),
405406
ShortName: "Get for installed IPv6 Entry - FIB ACK",
406407
RequiresFIBACK: true,
408+
RequiresIPv6: true,
407409
},
408410
}, {
409411
In: Test{

rib/rib_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,7 @@ func TestRIBAddEntry(t *testing.T) {
25582558
inRIB: func() *RIB {
25592559
r := New(defName)
25602560
if err := r.AddNetworkInstance("VRF-1"); err != nil {
2561-
t.Fatalf(fmt.Sprintf("cannot add network instance, %v", err))
2561+
t.Fatalf("cannot add network instance, %v", err)
25622562
}
25632563

25642564
_, fails, err := r.AddEntry(defName, &spb.AFTOperation{
@@ -2571,7 +2571,7 @@ func TestRIBAddEntry(t *testing.T) {
25712571
},
25722572
})
25732573
if err != nil || len(fails) != 0 {
2574-
t.Fatalf(fmt.Sprintf("cannot build test case, cannot add NH, got: %v or failed ops %d", err, len(fails)))
2574+
t.Fatalf("cannot build test case, cannot add NH, got: %v or failed ops %d", err, len(fails))
25752575
}
25762576

25772577
_, fails, err = r.AddEntry(defName, &spb.AFTOperation{

server/server.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ func (s *Server) Modify(ms spb.GRIBI_ModifyServer) error {
364364
return
365365
}
366366

367+
// update that we have received at least one message, to detect that we cannot
368+
// now re-set the parameters of the RPC.
367369
gotmsg = true
368370
// write the results to result channel.
369371
if !skipWrite {
@@ -377,7 +379,6 @@ func (s *Server) Modify(ms spb.GRIBI_ModifyServer) error {
377379
for {
378380
select {
379381
case res := <-resultChan:
380-
// update that we have received at least one message.
381382
if err := ms.Send(res); err != nil {
382383
errCh <- status.Errorf(codes.Internal, "cannot write message to client channel, %s", res)
383384
return

server/server_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func TestCheckParams(t *testing.T) {
456456
}
457457

458458
if errS := chkErrDetails(st, tt.wantErrDetails); errS != "" {
459-
t.Fatalf(errS)
459+
t.Fatal(errS)
460460
}
461461

462462
return
@@ -659,7 +659,7 @@ func TestRunElection(t *testing.T) {
659659
}
660660

661661
if errS := chkErrDetails(st, tt.wantErrDetails); errS != "" {
662-
t.Fatalf(errS)
662+
t.Fatal(errS)
663663
}
664664

665665
return

0 commit comments

Comments
 (0)