ducky/devices

Paddy 2015-11-28 Parent:f5a9d5f8f28d

12:03c49b4d3d9f Go to Latest

ducky/devices/memstore_test.go

Add doc comments to all our exported types. It makes golint happy, and it's a good thing to do. It's kind of shameful that we went so long without them. Oops.

History
paddy@4 1 package devices
paddy@4 2
paddy@9 3 import (
paddy@9 4 "fmt"
paddy@9 5
paddy@9 6 "golang.org/x/net/context"
paddy@9 7 )
paddy@9 8
paddy@4 9 func init() {
paddy@9 10 storerFactories = append(storerFactories, MemstoreFactory{})
paddy@4 11 }
paddy@9 12
paddy@9 13 type MemstoreFactory struct {
paddy@9 14 }
paddy@9 15
paddy@9 16 func (m MemstoreFactory) NewStorer(ctx context.Context) (Storer, error) {
paddy@9 17 return NewMemstore(), nil
paddy@9 18 }
paddy@9 19
paddy@9 20 func (m MemstoreFactory) TeardownStorer(storer Storer, ctx context.Context) error {
paddy@9 21 memstorer, ok := storer.(*Memstore)
paddy@9 22 if !ok {
paddy@9 23 return fmt.Errorf("Storer was not a *Memstore, was a %T", storer)
paddy@9 24 }
paddy@9 25 memstorer.devices = nil
paddy@9 26 return nil
paddy@9 27 }