Created
July 18, 2018 14:12
-
-
Save mschoch/709cb93295ca46acb4101cb78dba9a1f to your computer and use it in GitHub Desktop.
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" | |
"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