All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.6.0 - 2024-08-21
This release is largely centered around a refactoring of the Config
type and
the way that a Printer
is configured. It should not affect most users, but
does introduce some breaking changes for filter authors.
- Added
Annotator
,Config.Annotators
andWithAnnotator
, to add user-defined text annotations to rendered values. - Added
NewPrinter()
function, that accepts the following functional options:WithFilter()
WithDefaultFilters()
WithAnnotator()
WithUnexportedStructFields()
WithPackagePaths()
- [BC] Replaced
Config.OmitUnexportedFields
withRenderUnexportedStructFields
, note the logic is inverted. - [BC] Replaced
Config.OmitPackagePaths
withRenderPackagePaths
, note the logic is inverted. - Bumped the minimum supported Go version to 1.21.
- [BC] Removed
DefaultPrinter
, useNewPrinter()
instead. - [BC] Removed
Config.Indent
andDefaultIndent
constant. - [BC] Removed
Config.RecursionMarker
andDefaultRecursionMarker
constant. - [BC] Removed
Config.ZeroValueMarker
andDefaultZeroValueMarker
constant.
Renderer.Config()
andRenderer.WithModifiedConfig()
now properly clone the slices withinConfig
.
0.5.3 - 2024-04-08
- Fixed rendering of named types that was accidentally removed in 0.5.2.
0.5.2 - 2024-04-08
interface{}
is now rendered asany
.- Zero-valued arrays are now rendered with the "zero value marker", similarly to structs.
- Fixed inconsistent rendering of "element" type names within pointers, channels, maps, slices and functions.
0.5.1 - 2024-03-04
- Use zero-allocation natural sorting algorithm from
dogmatiq/jumble
.
0.5.0 - 2023-07-26
This release includes several changes to the experimental Filter
system in
preparation for unification of built-in and custom rendering behavior.
- Added
Renderer
interface. - Added
ErrorFilter
. Output for types that implementerror
now include the error message. - Added
Is()
,AsConcrete()
andAsImplementationOf()
helpers for use inFilter
implementations.
- [BC] The signature of
Filter
has changed to accept aRenderer
andValue
. - [BC] Renamed
ReflectTypeFilter
toReflectFilter
, it now applies to the entirereflect
package. - [BC] Renamed
ProtobufFilter
toProtoFilter
. - [BC] Changed
Config.Indent
to astring
.
- [BC] Removed
DurationFilter
.TimeFilter
now applies to the entiretime
package. - Removed dependency on Iago
- Fixed duplicate application of
Filter
that apply to specific interfaces when whenT
and*T
both implement the interface.
0.4.6 - 2023-02-27
- Fix rendering of
sync.RWMutex
under Go v1.20
0.4.5 - 2022-08-07
StringerFilter
now takes precedence over all other filtersFilterPrinter.Fallback()
now only skips the filter it was called from
0.4.4 - 2022-08-07
- Add
dapper.Stringer
interface for types that produce their own dapper representation
- Rendering of Protocol Buffers messages is now consistent with other types
0.4.3 - 2021-04-28
- Improved rendering of Protocol Buffers messages (thanks @mrubiosan)
0.4.2 - 2021-04-22
- Add
OmitUnexportedFields
option (thanks @mrubiosan)
0.4.1 - 2020-11-21
- Add
DefaultPrinter
, the printer used byWrite()
,Format()
andPrint()
0.4.0 - 2020-05-05
- Add
Config
to enscapsulate the configuration of aPrinter
- [BC] Change
DefaultIndent
fromstring
constant to[]byte
- [BC] The
Filter
function signature now accepts aConfig
andFilterPrinter
- Zero-value structs are now collapsed to
StructName{<zero>}
- [BC] Remove
Printer.Filters
,Indent
andRecursionMarker
- [BC] Remove
Value.TypeName()
- Add mutex lock around writes to
stdout
to prevent fragmented output (#45, thanks @ilmanzo)
0.3.5 - 2019-11-06
Print()
now accepts multiple arguments (#23)
- Fix panic when rendering unexported
time.Time
values (#24)
0.3.4 - 2019-11-05
- Byte slices and arrays are now rendered in hexdump format (#15)
- Improved rendering of
sync.Mutex
,RWMutex
andOnce
(#14) - Improved rendering of
time.Time
andDuration
(#8)
0.3.3 - 2019-04-23
- Render
reflect.Type
names when obtained from unexported struct fields (#9)
0.3.2 - 2019-02-06
- Bump Iago to v0.4.0
Printer()
now includes the name of user-definedstring
andbool
types (#6)iago.Print()
now prints a trailing newline (#7)
0.3.1 - 2019-01-29
- Bump Iago to v0.3.0
0.3.0 - 2019-01-20
- Added support for filters, allowing custom rendering on a per-value basis
- Added a built-in filter for
reflect.Type
- Fixed a bug whereby IO errors were not propagated to the caller
0.2.0 - 2019-01-19
- Added
Print()
, which prints directly toos.Stdout
- Fixed support for formatting of structs with unexported fields
0.1.1 - 2019-01-16
- Use Iago for indentation, etc
0.1.0 - 2019-01-16
- Initial release