From 546dfcd76dd228e0605359e9985f0b6a5672e8fa Mon Sep 17 00:00:00 2001 From: Gregory Mullen Date: Thu, 27 Jun 2019 10:33:12 -0700 Subject: Add new lib/dirstore to source completions from --- lib/dirstore.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/dirstore.go (limited to 'lib') diff --git a/lib/dirstore.go b/lib/dirstore.go new file mode 100644 index 00000000..e7ebb772 --- /dev/null +++ b/lib/dirstore.go @@ -0,0 +1,20 @@ +package lib + +type DirStore struct { + dirs []string +} + +func NewDirStore() *DirStore { + return &DirStore{ + dirs: make([]string, 0), + } +} + +func (store *DirStore) Update(dirs []string) { + store.dirs = make([]string, len(dirs)) + copy(store.dirs, dirs) +} + +func (store *DirStore) List() []string { + return store.dirs +} -- cgit