Dump displays the passed parameters to standard out with newlines, customizable indentation, and additional debug information such as complete types and all pointer addresses used to indirect to the final value. It provides the following features over the built-in printing facilities provided by the fmt package:
* Pointers are dereferenced and followed * Circular data structures are detected and handled properly * Custom Stringer/error interfaces are optionally invoked, including on unexported types * Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables * Byte arrays and slices are dumped like the hexdump -C command which includes offsets, byte values in hex, and ASCII output
The configuration options are controlled by an exported package global, spew.Config. See ConfigState for options documentation.
See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to get the formatted result as a string.
Dump is referenced in 166 repositoriesgithub.com/davecgh/go-spew
- 1 reference in spew/example_test.go
- 11 references in experiments/client/main.go
- 3 references in experiments/datastore_manager/main.go
- 2 references in experiments/client/find_by_name/main.go
- 1 reference in experiments/client/make_url/main.go
- 1 reference in experiments/client/move/main.go
- 3 references in atom/middleware.go
- 3 references in runtime/docker/runtime.go
- 2 references in atom/net/atom_dispatcher_test.go
- 1 reference in atom/atom.go
- 1 reference in atom/tokens.go