Commit Graph

27 Commits

Author SHA1 Message Date
Qi Xiao
9076934395 Remove most uses of the ioutil package.
https://golang.org/doc/go1.16#ioutil
2021-08-23 00:36:26 +01:00
Qi Xiao
1cc3faa15a Make use of (*testing.T).Cleanup in more places. 2021-08-06 23:49:11 +01:00
Qi Xiao
671c76be00 Add a lint Makefile target and CI task.
Both run staticcheck and go vet (but not golint).

Also make some small changes necessary to make the codebase lint-free under
staticcheck.
2021-07-08 00:13:38 +01:00
Qi Xiao
6e75f3468c Move API of pkg/store into pkg/storedefs.
This makes the nodaemon entrypoint not depend on boltdb at all, reducing its
size by 100KB (on darwin-arm64).
2021-06-19 01:54:00 +01:00
Qi Xiao
e69cde20dc pkg/store: Set options for temp store to improve performance. 2021-05-31 00:19:17 +01:00
Kurtis Rader
9b61cdc727 Be consistent about sync.WaitGroup var naming
Also, remove the unused dbStore.Waits() method. This came to my
attention while writing `peach` unit tests.
2021-05-30 00:40:42 +01:00
Kurtis Rader
60bcb27e16 Remove obsolete store API method
While working on issue #568 to add a `&dedup` option to the
`edit:command-history` command I noticed that the `store.Cmd.Cmds()`
method should be removed.
2021-05-30 00:33:37 +01:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Qi Xiao
11898f763a pkg/util: Break into fsutil/ and logutil/. 2020-09-03 05:27:18 +01:00
Kurtis Rader
eb2a792301 Fix some lint warnings
In addition to an uncontroversial spelling fix this addresses several,
related, warnings produced by the `golint` tool. In general I agree with
golint that unnecessary "else" blocks should be avoided. So this change
refactors those cases.

Note: I recognize that `golint` is deprecated (see
https://github.com/golang/go/issues/38968) since it is no longer being
maintained and there is controversy about its set of warnings. Nonetheless,
it appears that the warnings it emits for this project are all reasonable
and actionable with one potential exception: the naming of the `map_`
method in pkg/eval/compile_value.go.
2020-08-01 23:07:50 +01:00
Qi Xiao
a36a372624 pkg: Fix small issues found by staticcheck. 2020-04-13 13:56:10 +01:00
Qi Xiao
2b42ec0054 pkg/store/storetest: Match errors by messages, not by identity.
This will make it possible to use the test suites from pkg/daemon.
2020-04-06 00:46:01 +01:00
Qi Xiao
f8b4c50dc9 pkg/store: Move test code into a separate storetest package. 2020-04-06 00:39:57 +01:00
Qi Xiao
0fad3dff85 pkg/store: Remove global test fixture. 2020-04-05 16:24:52 +01:00
Qi Xiao
31f0eaa7b0 [cleanup] pkg: Remove ineffectual assignments. 2020-04-01 00:17:09 +01:00
Qi Xiao
762962260a Switch to etcd's fork of boltdb.
This resolves a data race in pkg/store.

This addresses #73.
2020-03-25 22:31:39 +00:00
Qi Xiao
95b9ba91d8 pkg/{store,daemon}: Introduce a new CmdsWithSeq method. 2019-12-27 11:48:34 +00:00
Qi Xiao
c2d82cafe5 pkg/store: Introduce a Cmd type for command history entries.
This type supersededs pkg/cli/histutil.Entry.
2019-12-27 11:13:33 +00:00
Qi Xiao
824b1c0e4f pkg/store: Merge interface.go into store.go. 2019-12-26 23:13:46 +00:00
Qi Xiao
6b876e559d pkg/store: Interface -> Store. 2019-12-26 18:09:26 +00:00
Qi Xiao
215233cd17 pkg/store: Move EnsureDataDir to pkg/runtime. 2019-12-26 18:07:28 +00:00
Qi Xiao
cbe0e3e7e7 Merge pkg/store/storedefs into pkg/store. 2019-12-26 18:05:13 +00:00
Qi Xiao
d195327756 pkg/store: ErrNoVar -> ErrNoSharedVar. 2019-12-26 17:53:50 +00:00
Qi Xiao
2e2e724e3d pkg/store: De-export all Bucket* constants. 2019-12-26 17:52:28 +00:00
Qi Xiao
04d1740fc4 pkg/store: Remove check for schema version. 2019-12-26 17:50:32 +00:00
Qi Xiao
41ae0d3c1c pkg/store: Make Store an interface, rename to DBStore. 2019-12-26 17:40:25 +00:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00