Replace godep with dep
This commit is contained in:
parent
1e7489927c
commit
bf5616c65b
14883 changed files with 3937406 additions and 361781 deletions
30
vendor/github.com/peterbourgon/diskv/examples/super-simple-store/super-simple-store.go
generated
vendored
Normal file
30
vendor/github.com/peterbourgon/diskv/examples/super-simple-store/super-simple-store.go
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/peterbourgon/diskv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
d := diskv.New(diskv.Options{
|
||||
BasePath: "my-diskv-data-directory",
|
||||
Transform: func(s string) []string { return []string{} },
|
||||
CacheSizeMax: 1024 * 1024, // 1MB
|
||||
})
|
||||
|
||||
key := "alpha"
|
||||
if err := d.Write(key, []byte{'1', '2', '3'}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
value, err := d.Read(key)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("%v\n", value)
|
||||
|
||||
if err := d.Erase(key); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue