INNER CODE UNIT · Go

interactWithStore

philippgille/gokv · docs.go:38

	func interactWithStore(store gokv.Store) {
		// Store value
		val := foo{
			Bar: "baz",
		}
		err := store.Set("foo123", val)
		if err != nil {
			panic(err)
		}

		// Retrieve value
		retrievedVal := new(foo)
		found, err := store.Get("foo123", retrievedVal)
		if err != nil {
			panic(err)
		}
		if !found {
			panic("Value not found")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…