Skip to content

Commit 8cfa591

Browse files
committed
update examples
1 parent 087ab44 commit 8cfa591

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ func main() {
3636
lim := bwlimit.NewLimiter(100, 0)
3737
defer lim.Stop()
3838

39-
// wrap the default http transport DialContext
39+
// set the default http transport DialContext
4040
tp := http.DefaultTransport.(*http.Transport)
41-
tp.DialContext = lim.Wrap(tp.DialContext)
41+
tp.DialContext = lim.Wrap(nil).DialContext
4242

4343
// make a request and time it
4444
now := time.Now()

example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func ExampleLimiter_NewLimiter() {
2121
lim := bwlimit.NewLimiter(100, 0)
2222
defer lim.Stop()
2323

24-
// wrap the default http transport DialContext
24+
// set the default http transport DialContext
2525
tp := http.DefaultTransport.(*http.Transport)
2626
tp.DialContext = lim.Wrap(nil).DialContext
2727

0 commit comments

Comments
 (0)