Fixing issue #857 will require some non-trivial work. But I noticed these
documentation cleanups when I started working on the issue so I'm making
them as an independent change.
Related #857
I was working on issue #661 and noticed that github.com/kr/pty was dead
when I ran into a problem with that module on macOS (GOARCH == darwin).
Replace that dependency with github.com/creack/pty which is ostensibly
being actively maintained.
I also chose to remove a couple of obsolete module signatures at the
same time.
Also remove unused functions.
There were two (correct) implementations of deciding whether a string has
another string as a subsequence; keep the more performant one.
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