Skip to content

Commit

Permalink
Merge pull request #21 from tangyang9464/master
Browse files Browse the repository at this point in the history
fix: update Simple Example
  • Loading branch information
hsluoyz authored Oct 14, 2021
2 parents 46814bf + 21543dc commit 755034f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ func updateCallback(msg string) {
func main() {
// Initialize the watcher.
// Use the Redis host as parameter.
w, _ := watcher.NewWatcher("localhost:6379", watcher.WatcherOptions{
w, _ := rediswatcher.NewWatcher("localhost:6379", rediswatcher.WatcherOptions{
Options: redis.Options{
Network: "tcp",
Password: "",
},
Channel: "/casbin",
IgnoreSelf: true,
// Only exists in test, generally be true
IgnoreSelf: false,
})

// Initialize the enforcer.
Expand All @@ -53,6 +54,8 @@ func main() {
// Update the policy to test the effect.
// You should see "[casbin rules updated]" in the log.
_ = e.SavePolicy()
// Only exists in test
fmt.Scanln()
}

```
Expand Down

0 comments on commit 755034f

Please sign in to comment.