go-cmp v0.2.0 Release Notes

Release Date: 2018-02-20 // over 4 years ago
  • ➕ Added Features:

    ➕ Add implicit filter to transformers where a Transformer can only apply if that specific transformer does not already exist within the tail of the current Path since the last non-transform step. This filter makes it easier to create same-type transformations (e.g., func(T) T) without needing to manually add your own filter. (#29)

    ➕ Add Path.Index method, which provides an easier way to index a Path without needing to manually perform bounds checking. (#56)

    ➕ Add Transform.Option method, which returns the original Transformer option. This enables the creation of non-reentrant transformers. (#59)

    ➕ Add handling for purego build tag, which prevents use of unsafe, which is necessary to implementAllowUnexported. However, unsafe is not available in some build environments such as GopherJS and Google AppEngine Standard. A future release will remove special casing for these two environments. (#68)

    Reporting changes:

    • Diff only batches multiple differences together for slices of primitives. (#45)
    • 🖨 Diff prints uses a s prefix to indicate that the String method was used. (#46)
    • 🖨 Diff prints strings using the raw literal syntax when helpful. (#46)
    • Diff reports the type of a primitive when helpful. (#65)
    • 🖨 Path.GoString elides printing type assertions on anonymous types. (#21)

    🐛 Bug fixes:

    • 🖨 Unexported map values no longer panics when printing. (#38)
    • Explicitly convert assignable nil interface values. This works around a reflect bug present in Go1.9 and below. (#49)