Skip to content

Instantly share code, notes, and snippets.

@mschoch
Created July 18, 2018 14:12
Show Gist options
  • Save mschoch/709cb93295ca46acb4101cb78dba9a1f to your computer and use it in GitHub Desktop.
Save mschoch/709cb93295ca46acb4101cb78dba9a1f to your computer and use it in GitHub Desktop.
package main
import (
"log"
"os"
"github.com/couchbase/vellum"
)
func main() {
os.RemoveAll("velltest.vellum")
f, err := os.Create("velltest.vellum")
if err != nil {
log.Fatal(err)
}
v, err := vellum.New(f, nil)
if err != nil {
log.Fatal(err)
}
keys := []string{"thurs", "thursday"}
vals := []uint64{10, 5}
for i, key := range keys {
err = v.Insert([]byte(key), vals[i])
if err != nil {
log.Fatal(err)
}
}
err = v.Close()
if err != nil {
log.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment