Skip to content

Commit 5cff051

Browse files
Dean KarnDean Karn
authored andcommitted
Merge pull request #4 from joeybloggs/v1
Add missing struct documentation + update test code for go vet
2 parents 9e9d1f4 + 71e409f commit 5cff051

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pool.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ const (
1111
errRecoveryString = "recovering from panic: %+v\nStack Trace:\n %s"
1212
)
1313

14+
// ErrRecovery contains the error when a consumer goroutine needed to be recovers
1415
type ErrRecovery struct {
1516
s string
1617
}
1718

19+
// Error prints recovery error
1820
func (e *ErrRecovery) Error() string {
1921
return e.s
2022
}

pool_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ func TestPanicRecovery(t *testing.T) {
118118
i := job.Params()[0].(int)
119119
if i == 1 {
120120
panic("OMG OMG OMG! something bad happened!")
121-
return
122121
}
123122
time.Sleep(time.Second * 1)
124123
job.Return(i)
@@ -135,7 +134,7 @@ func TestPanicRecovery(t *testing.T) {
135134
err, ok := result.(*ErrRecovery)
136135
if ok {
137136
count++
138-
err.Error()
137+
NotEqual(t, len(err.Error()), 0)
139138
}
140139
}
141140

0 commit comments

Comments
 (0)