Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
docs(ipset): improve example and README
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyonlin committed Sep 15, 2020
1 parent a07c430 commit 974d7d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions ipset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ func main() {
// output: test
log.Println(set.Name())

set.Flush()
_ = set.Flush()

set.Add("1.1.1.1", ipset.Timeout(time.Hour))
_ = set.Add("1.1.1.1", ipset.Timeout(time.Hour))

ok, _ := set.Test("1.1.1.1")
// output: true
Expand All @@ -67,12 +67,12 @@ func main() {
log.Println(ok)

info, _ := set.List()
// output:
// output: &{test hash:ip 4 family inet hashsize 1024 maxelem 65536 timeout 3600 216 0 [1.1.1.1 timeout 3599]}
log.Println(info)

set.Del("1.1.1.1")
_ = set.Del("1.1.1.1")

set.Destroy()
_ = set.Destroy()
}
```

Expand Down
10 changes: 5 additions & 5 deletions ipset/README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ func main() {
// output: test
log.Println(set.Name())

set.Flush()
_ = set.Flush()

set.Add("1.1.1.1", ipset.Timeout(time.Hour))
_ = set.Add("1.1.1.1", ipset.Timeout(time.Hour))

ok, _ := set.Test("1.1.1.1")
// output: true
Expand All @@ -65,12 +65,12 @@ func main() {
log.Println(ok)

info, _ := set.List()
// output:
// output: &{test hash:ip 4 family inet hashsize 1024 maxelem 65536 timeout 3600 216 0 [1.1.1.1 timeout 3599]}
log.Println(info)

set.Del("1.1.1.1")
_ = set.Del("1.1.1.1")

set.Destroy()
_ = set.Destroy()
}
```

Expand Down
2 changes: 1 addition & 1 deletion ipset/_examples/quickstart/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func main() {
log.Println(ok)

info, _ := set.List()
// output:
// output: &{test hash:ip 4 family inet hashsize 1024 maxelem 65536 timeout 3600 216 0 [1.1.1.1 timeout 3599]}
log.Println(info)

_ = set.Del("1.1.1.1")
Expand Down

0 comments on commit 974d7d9

Please sign in to comment.