aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregory Mullen <greg@cmdline.org>2019-06-27 10:33:12 -0700
committerDrew DeVault <sir@cmpwn.com>2019-06-29 14:24:19 -0400
commit546dfcd76dd228e0605359e9985f0b6a5672e8fa (patch)
treeac319094d0361c3ed41765c027cbaad2db5b05af /lib
parent2a0961701c4cabecc53d134ed1782e5612e64580 (diff)
Add new lib/dirstore to source completions from
Diffstat (limited to 'lib')
-rw-r--r--lib/dirstore.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/dirstore.go b/lib/dirstore.go
new file mode 100644
index 0000000..e7ebb77
--- /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
+}