Skip to content

Commit

Permalink
Lint Fixes (#202)
Browse files Browse the repository at this point in the history
* examples: fix dropped errors

* test: break from loop, not just select

* internal/core: remove unused dialing field from dialer
  • Loading branch information
alrs authored Aug 24, 2020
1 parent 3139ecf commit ba09875
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions examples/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ func server(url string) {
die("can't create context on rep socket: %s", err)
}
msg, err = ctx.Recv()
if err != nil {
die("can't receive from context: %s", err)
}
fmt.Printf("Worker %d: Received request '%s'\n", id, string(msg))

// Sleep for a random amount of time to simulate "work"
Expand Down
3 changes: 3 additions & 0 deletions examples/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func node0(url string) {
for {
// Could also use sock.RecvMsg to get header
msg, err = sock.Recv()
if err != nil {
die("cannot receive from mangos Socket: %s", err.Error())
}
fmt.Printf("NODE0: RECEIVED \"%s\"\n", msg)

if string(msg) == "STOP" {
Expand Down
3 changes: 3 additions & 0 deletions examples/reqrep/reqrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func node0(url string) {
for {
// Could also use sock.RecvMsg to get header
msg, err = sock.Recv()
if err != nil {
die("cannot receive on rep socket: %s", err.Error())
}
if string(msg) == "DATE" { // no need to terminate
fmt.Println("NODE0: RECEIVED DATE REQUEST")
d := date()
Expand Down
1 change: 0 additions & 1 deletion internal/core/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type dialer struct {
addr string
closed bool
active bool
dialing bool
asynch bool
redialer *time.Timer
reconnTime time.Duration
Expand Down
3 changes: 2 additions & 1 deletion test/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,15 @@ func slowStart(_ *testing.T, cases []TestCase) bool {
}

timeout := time.After(time.Second * 5)
Loop:
for numexit < needrdy {
select {
case <-timeout:
if !exitqclosed {
close(exitq)
exitqclosed = true
}
break
break Loop
case <-wakeq:
numexit++
}
Expand Down

0 comments on commit ba09875

Please sign in to comment.