Last active
December 21, 2015 21:09
-
-
Save mpl/6366649 to your computer and use it in GitHub Desktop.
basic kv test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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