Commit Graph

17 Commits

Author SHA1 Message Date
Qi Xiao
51e4d97568 interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
Qi Xiao
8e117a2875 Merge pkg/daemon/client into pkg/daemon.
Also merge and rename files to make the client/server separation clearer.
2021-09-30 23:37:36 +01:00
Qi Xiao
27eec7c8ee Reorganize the daemon module.
* Move client, spawning and activation code into pkg/daemon/client.

* Move API types into pkg/daemon/daemondefs.
2021-06-19 01:06:11 +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
72fc2dbe4a Copy and trim down the net/rpc package.
In particular, the dependency on net/http is removed, which removes a
bunch of transitive dependencies.
2021-01-30 23:56:58 +00:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Kurtis Rader
b5b3a0d607 go vet cleanup
Most of the code uses keyed fields in composite literals; i.e., struct
literals. However, running `go vet ./...` reports a few places that use
anonymous fields. This modifies those composite literals to use keyed
fields. This does make the code a bit more verbose without reducing
the likelihood of a bug. But it does make the code more consistent, use
best practices, and make it easier to notice if a potential problem is
introduced when running `go vet ./...` since that command now produces
no diagnostic output.

I considered adding a `make vet` target that explicitly ran

    go vet -composites=false ./...

I decided not to do that since consistently using keyed composite literals
is preferable to having a mix of keyed and unkeyed composite literals.

This also removes the unused `ExampleLoop` function which causes this
`go vet` warning:

    pkg/cli/loop_test.go:130:1: ExampleLoop refers to unknown identifier: Loop
2020-09-03 04:24:06 +01:00
Qi Xiao
f55bc315c9 pkg/daemon: Run tests from pkg/store/storetest.
This addresses #944.

Also fix a bug with DelSharedVar that was found by the new test.
2020-04-06 00:48:48 +01:00
Qi Xiao
b93ef8aa4a pkg/daemon: Add more tests, and remove unused code.
This addresses #944.
2020-04-06 00:19:03 +01:00
Qi Xiao
f6d036cb48 pkg/daemon: Fix the CmdsWithSeq client. 2019-12-28 02:01: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
6b876e559d pkg/store: Interface -> Store. 2019-12-26 18:09:26 +00:00
Qi Xiao
cbe0e3e7e7 Merge pkg/store/storedefs into pkg/store. 2019-12-26 18:05:13 +00:00
Qi Xiao
8ed2c0c461 pkg/daemon: Move API types into an internal package. 2019-12-26 17:26:59 +00:00
Qi Xiao
012b779ca7 pkg/daemon: Make Client an interface. 2019-12-26 17:23:18 +00:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00