In addition to fixing the encoding bugs standardize on \xNN notation for
bytes rather than \uNNNN; e.g., \x00 rather than \u0000.
Also, update the documentation for double-quoted strings to include the
\e sequence.
Fixes#1528
This change is a preparation step for refining all *Op types to return Exception
as the error.
Keeping Exception as a struct type will make such a change error-prone, since
a (*Exception)(nil) != error(nil), so if an *Op returns a nil *Exception, it
is not nil if the return value is stored in an error-typed variable.
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
* Use a "type" field to identify the type, instead of predicates in the exc:
module.
* Make the reason values behave more like structmaps, including a Repr that
mimics a map.
This fixes#208.