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

Commit

Permalink
README updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextoumbourou committed May 4, 2015
1 parent 42f2c34 commit c6ff977
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ import (
func main() {
h := goodhosts.NewHosts()

if h.HasEntry("127.0.0.1", "facebook") {
if h.Has("127.0.0.1", "facebook") {
fmt.Println("Entry exists!")
} else {
fmt.Println("Entry doesn't exist!")
return
}

fmt.Println("Entry doesn't exist!")
}
```

Expand All @@ -129,7 +130,7 @@ func main() {
h := goodhosts.NewHosts()

// Note that nothing will be added to the hosts file until ``Flush`` is called.
h.AddEntry("127.0.0.1", "facebook.com")
h.Add("127.0.0.1", "facebook.com", "twitter")

if err := h.Flush(); err != nil {
panic(err)
Expand All @@ -151,7 +152,7 @@ func main() {
h := goodhosts.NewHosts()

// Same deal, yo: call h.Flush() to make permanent.
h.RemoveEntry("127.0.0.1", "facebook")
h.Remove("127.0.0.1", "facebook", "twitter")

if err := h.Flush(); err != nil {
panic(err)
Expand All @@ -163,6 +164,13 @@ func main() {

## Changelog

### 2.0.0 (2015-05-04)

* Breaking API change.
* Add support for adding and removing multiple hosts.
* Added ``--all`` flag.
* Handle malformed IP addresses.

### 1.0.0 (2015-05-03)

- Initial release.
Expand Down

0 comments on commit c6ff977

Please sign in to comment.