README examples don't compile
Closed this issue · 0 comments
dmjones commented
The examples show how to read everything from a database:
// Read all fish from the database, unmarshaling the response.
records, err := db.ReadAll("fish")
if err != nil {
fmt.Println("Error", err)
}
fish := []Fish{}
if err := json.Unmarshal([]byte(records), &fish); err != nil {
fmt.Println("Error", err)
}
However, db.ReadAll
returns a []string
, which cannot be cast to []byte
in the call to json.Unmarshal
.