From 81c37e551f1b66c1c732b8bf5640aac56d5e2349 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Tue, 27 May 2014 20:41:30 -0500 Subject: [PATCH] Fix documentation code examples. The examples uses a btcutil API that was recently updated from passing btcwire.BitcoinNet to *btcnet.Params. This change updates the btcutil call in the examples, as well as modifying the example in the README to match that in doc.go (where errors were handled slightly differently). --- README.md | 6 +++--- doc.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6baad9ce..7cdd4a84 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ package main import ( "flag" "fmt" + "log" "github.com/conformal/btcnet" "github.com/conformal/btcutil" @@ -42,10 +43,9 @@ func main() { // Create and print new payment address, specific to the active network. pubKeyHash := make([]byte, 20) - addr, err := btcutil.NewAddressPubKeyHash(pubKeyHash, netParams.Net) + addr, err := btcutil.NewAddressPubKeyHash(pubKeyHash, netParams) if err != nil { - // badness - return + log.Fatal(err) } fmt.Println(addr) } diff --git a/doc.go b/doc.go index f3d8d2b1..649d4a17 100644 --- a/doc.go +++ b/doc.go @@ -48,7 +48,7 @@ // // // Create and print new payment address, specific to the active network. // pubKeyHash := make([]byte, 20) -// addr, err := btcutil.NewAddressPubKeyHash(pubKeyHash, netParams.Net) +// addr, err := btcutil.NewAddressPubKeyHash(pubKeyHash, netParams) // if err != nil { // log.Fatal(err) // }