summaryrefslogtreecommitdiff
path: root/spew/config.go
AgeCommit message (Collapse)Author
2024-01-14flatten pathsv1.1.3Jeff Carr
Signed-off-by: Jeff Carr <[email protected]>
2016-10-29Update license copyright years.Dave Collins
Several files had been updated since the listed years. This updates them accordingly.
2016-10-28Adds new config options:Alexander Staubo
DisablePointerAddresses: Specifies whether to disable the printing of pointer addresses. DisableCapacities specifies whether to disable the printing of capacities for arrays, slices, maps and channels. These are useful when diffing data structures in tests. Printing pointers and capacities would otherwise lead to false negatives.
2016-09-07Deprecate "disableunsafe" tag in favor of "safe".Dave Collins
This adds a new build tag named "safe" which serves the exact same purpose as the current "disableunsafe" tag. This is being done, as recommended by @shurcooL, since it is emerging as the standard way to do it in several high profile packages, it mirrors the "unsafe" package nicely, it is shorter, and users generally seem to prefer it. However, to avoid breaking existing infrastructure, the disableunsafe tag is still available and simply is being deprecated.
2015-06-19Add support for limited mode without unsafe pkg.Dave Collins
This commit adds support for compiling spew without the unsafe package. When compiled without the unsafe package, some of the more advanced features such as invoking stringers on pointers from non-pointer variables and unexported struct fields are not available. By default, spew will be compiled in the limited mode for Google App Engine since the unsafe package is not available there. Additionally, spew can be compiled without the unsafe package manually by specifying the "disableunsafe" build tag. Finally, a new package-level constant named "UnsafeDisabled" has been exposed which can be used to programmatically determine if spew was compiled with access to the unsafe package.
2015-04-10Enable methods to sort map keys and spew itself as last resortTim Hockin
If enabled by flags, try to use methods to stringify map keys and sort on that. If we can't use primitive sorting and we can't use methods, we can still fall back on spew itself. If SpewKeys is enabled, use Sprintf("%#v") to generate a string and sort by that.
2013-11-16Add SortKeys option to doco for NewDefaultConfig.Dave Collins
2013-11-16Update README and doc.go with new SortKeys option.Dave Collins
2013-11-14Fix a few style issues pointed out by golint.Dave Collins
2013-10-28dump: make SortKeys default to string representation instead of nothingPatrick Mezard
The previous version of SortKeys was sorting only native types. Now, if the type is unknown it defaults to its reflect.Value.String() representation which at least guarantees display stability.
2013-10-27config: add SortKeys option to sort native map keys before displayPatrick Mezard
If ConfigState.SortKeys is true, then dump and format will sort map keys before displaying them. Only native types (bool, ints, uint, uintptr, string) are supported, other slices are left unchanged. The motivation is to have more diffable output, mostly for test purpose.
2013-03-11Update docs for new Sdump function.Dave Collins
2013-03-11Add support for Sdump.Dave Collins
This commit adds a function named Sdump which works exactly like Dump and Fdump except it returns the formatted output as a string. This serves the same purpose as the the Sprint* family of functions.
2013-03-08Update docs for new byte array and slice behavior.Dave Collins
2013-03-03Cleanup documentation on new ContinueOnMethod code.Dave Collins
This commit expands on TShadwell's work attached to issue #8. It rounds out the documentation for the new option.
2013-02-26Re-added accidentally removed linesThomas NJ Shadwell
2013-02-26revert previous mis-commits, add ability to allow deeper pretty-printing ↵Thomas NJ Shadwell
after an error or Stringer interface is encountered.
2013-02-23Add support Sprint* family of functions.Dave Collins
This commit implements wrappers for the fmt.Sprint, fmt.Sprintf, and fmt.Sprintln functions as requested in issue #7.
2013-01-19Move SpewState methods to ConfigState.Dave Collins
Rather than stuffing a ConfigState instance into a separate SpewState, just add the functionality directly to the ConfigState. This provides simpler syntax for the consumer. One side effect of this change is that, unlike a zero value SpewState, a zero value ConfigState doesn't provide default values which means the Indent field is set to provide no indentation. The consumer is now expected to set the indent to their desired value when declaring an instance of ConfigState. Alternatively, the consumer can call a new function, NewDefaultConfig, which returns a ConfigState with default values, including a default indentation of a single space. For example, to change the indent to a tab, the previous syntax was: ss := new(spew.SpewState) // or var ss spew.SpewState scs := ss.Config() scs.Indent = "\t" scs.Dump(whatever) The new syntax is simply: scs := spew.ConfigState{Indent: "\t"} scs.Dump(whatever)
2013-01-12Update ConfigState documentation.Dave Collins
There is now support for concurrent configuration through the use of SpewState instances. Update the documenation to properly reflect this.
2013-01-12Implement support for unqiue config instances.Dave Collins
This commit adds a new type, SpewState, which can be used to create instances with unique configuration options. The methods of SpewState are equivalent to the top-level functions. Full documentation and examples are included.
2013-01-08Initial implementation.Dave Collins