Skip to content

Commit

Permalink
Simplify agent execution code in the example
Browse files Browse the repository at this point in the history
  • Loading branch information
nakabonne committed Nov 8, 2020
1 parent 4a9e7d8 commit 687c244
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,11 @@ Import `github.com/nakabonne/gosivy/agent` into the target application to launch
```go
package main

import (
"log"
"time"

"github.com/nakabonne/gosivy/agent"
)
import "github.com/nakabonne/gosivy/agent"

func main() {
if err := agent.Listen(agent.Options{}); err != nil {
log.Fatal(err)
panic(err)
}
defer agent.Close()
}
Expand All @@ -95,19 +90,14 @@ Give the address the agent listens on:
```go
package main

import (
"log"
"time"

"github.com/nakabonne/gosivy/agent"
)
import "github.com/nakabonne/gosivy/agent"

func main() {
err := agent.Listen(agent.Options{
Addr: "127.0.0.1:9090",
})
if err != nil {
log.Fatal(err)
panic(err)
}
defer agent.Close()
}
Expand Down

0 comments on commit 687c244

Please sign in to comment.