Skip to content

Commit e0a97d7

Browse files
committed
defer lim.Stop()
1 parent 0fdd2fa commit e0a97d7

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func main() {
3434

3535
// limit reads to 100 bytes/sec, unlimited writes
3636
lim := bwlimit.NewLimiter(100, 0)
37+
defer lim.Stop()
3738

3839
// wrap the default http transport DialContext
3940
tp := http.DefaultTransport.(*http.Transport)

example_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func ExampleLimiter_NewLimiter() {
1919

2020
// limit reads to 100 bytes/sec, unlimited writes
2121
lim := bwlimit.NewLimiter(100, 0)
22+
defer lim.Stop()
2223

2324
// wrap the default http transport DialContext
2425
tp := http.DefaultTransport.(*http.Transport)

0 commit comments

Comments
 (0)