davecgh / go-spew

Implements a deep pretty printer for Go data structures to aid in debugging

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Suggestion] Configuration for dumping integers as hex instead of decimal

hyperfocusaurus opened this issue · comments

I'm currently writing a C64 emulator in Go, and using spew to dump out the CPU state whenever I hit an instruction I haven't implemented yet, or read from / write to a part of the address space that I haven't emulated yet. Currently I'm translating the decimal output into hex so I can cross-reference with documentation and the ROM disassembly manually, but it occurred to me that a small change to the spew library could add the capability to automate this task, simply by adding an option to always apply a hex format to every int.

I can make a PR for this idea but I wanted to first posit the idea in case either a) it's already possible and I'm just too stupid to figure out how, or b) someone has a compelling reason why this functionality should not be implemented in this library.

Let me know what you think anyway.