Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
It should be clear you must include self when calling `pool.Set()` See #27
  • Loading branch information
thrawn01 authored Apr 6, 2021
1 parent 6251eaf commit 2fc526b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ import (
)

func ExampleUsage() {
// Keep track of peers in our cluster and add our instance to the pool `http://localhost:8080`
pool := groupcache.NewHTTPPoolOpts("http://localhost:8080", &groupcache.HTTPPoolOptions{})
// Keep track of peers in our cluster and add our instance to the pool `http://192.168.1.1:8080`
pool := groupcache.NewHTTPPoolOpts("http://192.168.1.1:8080", &groupcache.HTTPPoolOptions{})

// Add more peers to the cluster
pool.Set("http://peer1:8080", "http://peer2:8080")
// Add more peers to the cluster (Ensure our instance is included)
pool.Set("http://192.168.1.1:8080", "http://192.168.1.2:8080", "http://192.168.1.3:8080")

server := http.Server{
Addr: "localhost:8080",
Addr: "192.168.1.1:8080",
Handler: pool,
}

Expand Down

0 comments on commit 2fc526b

Please sign in to comment.