Skip to content

Commit

Permalink
Add comments to the example code
Browse files Browse the repository at this point in the history
Solves #28
  • Loading branch information
tevino authored Jan 3, 2024
1 parent 8d02d3d commit 1af4528
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ The reason for a fake implementation is that there is currently no way to perfor
```go
import "github.com/tevino/tcp-shaker"

// Initializing the checker
// It is expected to be shared among goroutines, only one instance is necessary.
c := NewChecker()

ctx, stopChecker := context.WithCancel(context.Background())
Expand All @@ -73,6 +75,8 @@ go func() {

<-c.WaitReady()

// Checking google.com

timeout := time.Second * 1
err := c.CheckAddr("google.com:80", timeout)
switch err {
Expand Down

0 comments on commit 1af4528

Please sign in to comment.