The htmldump package is a Go tool for developers, designed to simplify the visualization of Go data structures by converting them into HTML tables. This functionality is particularly useful during development and debugging, as it provides a clear and organized view of complex data.
The htmldump package supports a wide range of Go data types, including:
- Structs (including nested structs, as demonstrated in the
packexample) - Slices
- Maps
- Basic types (e.g., strings, integers, floats)
By leveraging the htmldump package, developers can quickly inspect and analyze their data in a user-friendly format, enhancing productivity and reducing debugging time.
The example/example.go file provides a complete example of how to use the htmldump package. It includes:
-
Clone the repository:
git clone https://github.com/oslyak/htmldump.git cd htmldump -
Install dependencies:
go mod tidy
-
Run the example:
go run example/example.go
-
The generated HTML file (
example.html) will open in your default browser.
- Add to your project:
go get github.com/oslyak/htmldump@v1.0.0
- gofakeit: Used for generating random data.
This project is licensed under the MIT License. See the LICENSE file for details.