package rootstate import "os" type liveStore interface { HoldLive(string) (func(), error) LiveHeld(string) (bool, error) } func HoldLive(s Store, name string) (func(), error) { if s, ok := s.(liveStore); ok { return s.HoldLive(name) } return nil, os.ErrPermission } func LiveHeld(s Store, name string) (bool, error) { if s, ok := s.(liveStore); ok { return s.LiveHeld(name) } return false, os.ErrPermission }