From c6ff977432ff3bb3eeb226e83e3bd944481bb01e Mon Sep 17 00:00:00 2001 From: Lex Toumbourou Date: Mon, 4 May 2015 22:49:16 +1000 Subject: [PATCH] README updates. --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3c54045..9f6c2fe 100644 --- a/README.md +++ b/README.md @@ -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!") } ``` @@ -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) @@ -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) @@ -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.