From 4422b14f63ff92faf5d4f7042a2ce6141ab9744d Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Tue, 8 Jul 2014 09:25:47 -0500 Subject: [PATCH] Categorize NewestSha example under Db interface. It seems the godoc example extraction does not recognize the same syntax used for functions with receivers when working with interfaces. So, instead, categorize the example on the interface. --- README.md | 2 +- example_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3ec1b0f0..2318a5b6 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ $ go get github.com/conformal/btcdb Demonstrates creating a new database and inserting the genesis block into it. * [NewestSha Example] - (http://godoc.org/github.com/conformal/btcdb#example-CreateDB) + (http://godoc.org/github.com/conformal/btcdb#example-Db) Demonstrates querying the database for the most recent best block height and hash. diff --git a/example_test.go b/example_test.go index 79219a28..c9e632fb 100644 --- a/example_test.go +++ b/example_test.go @@ -49,8 +49,8 @@ func ExampleCreateDB() { // New height: 0 } -// exampleLoadDb is used in the example to elide the setup code. -func exampleLoadDb() (btcdb.Db, error) { +// exampleLoadDB is used in the example to elide the setup code. +func exampleLoadDB() (btcdb.Db, error) { db, err := btcdb.CreateDB("memdb") if err != nil { return nil, err @@ -68,11 +68,11 @@ func exampleLoadDb() (btcdb.Db, error) { // This example demonstrates querying the database for the most recent best // block height and hash. -func ExampleDb_NewestSha() { +func ExampleDb() { // Load a database for the purposes of this example and schedule it to // be closed on exit. See the CreateDB example for more details on what // this step is doing. - db, err := exampleLoadDb() + db, err := exampleLoadDB() if err != nil { fmt.Println(err) return