Skip to content

Instantly share code, notes, and snippets.

@mpl
Last active December 21, 2015 21:09
Show Gist options
  • Save mpl/6366649 to your computer and use it in GitHub Desktop.
Save mpl/6366649 to your computer and use it in GitHub Desktop.
basic kv test
package main
import (
"log"
"github.com/cznic/kv"
)
func testKv() {
fullPath := "foo.kv"
db, err := kv.Create(fullPath, &kv.Options{})
if err != nil {
log.Fatalf("Could not create/open new kvdb at %v, %v", fullPath, err)
}
err = db.Set([]byte("Hello"), []byte("you"))
if err != nil {
log.Fatalf("Could not write on db: %v", err)
}
err = db.Close()
if err != nil {
log.Fatalf("Could not close db: %v", err)
}
}
func main() {
testKv()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment