Tags: smooth80stech/go-cmp
Tags
Support purego build tag (google#68) The proposal in golang/go#23172 was accepted. The "purego" build tag is intended to be a community agreed upon soft-signal to indicate the forbidden use of unsafe, assembly, or cgo. A change in the future will remove special-casing the appengine and js tags once the related toolchains support purego (possibly after some bake-in period).
Refactor option evaluation logic (google#32) The previous implementation of options had a single "option" type that was used to represent either an Ignore, Comparer, or Transformer and all of the filters relevant to each of them. We refactor this logic by creating a new type to represent each of the fundamental options and filtering options. Construction of filtered options is now as simple as wrapping the input option with the appropriate filter type. Evaluation of filters now takes a top-down two-step approach where 1. We start with the set of all options, and recursively apply the filters to create the "applicable" set S. 2. We apply the set S. Both steps are represented as the filter and apply methods on each of the core options. This approach has the following advantages: * It is faster because the same filter that was applied to multiple options now only needs to execute once. * It more closely matches the documented algorithm in cmp.Equal. * It allows for easier extension of the API to add new fundamental option types.
PreviousNext