Go implementation of Rust's dbg macro for enhanced print debugging with file and line number context.
godbg is a Go package that implements Rust's `dbg` macro functionality for enhanced print debugging. It automatically prints variable values along with file names and line numbers, eliminating the need for manual formatting in debug statements. The tool is designed specifically for developers who rely on print debugging as part of their workflow.
Go developers who frequently use print statements for debugging and want a more efficient workflow with automatic context. Particularly useful for those familiar with Rust's debugging approach who want similar functionality in Go.
Developers choose godbg because it provides Rust-like debugging convenience in Go with zero configuration, automatically adding file and line context to debug output. It reduces boilerplate code and speeds up debugging by eliminating manual formatting of debug messages.
Go implementation of the Rust dbg macro
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically adds file name and line number to debug output, as shown in the example '[main.go:7] a = 1', eliminating manual formatting and saving development time.
Displays both the variable name and its value in output, making debug statements self-documenting and reducing boilerplate code, evidenced by Dbg(a) outputting 'a = 1'.
Requires only a single import statement with minimal code changes, as demonstrated by importing 'github.com/tylerwince/godbg' and calling Dbg() directly.
Brings the popular dbg macro pattern from Rust to Go, offering a familiar and efficient debugging experience for developers transitioning between languages.
The README explicitly states that tests are planned but not yet implemented, which raises reliability concerns for use in critical or production environments.
Planned features like fancy mode (callstack info), performance optimizations, and typing information are not available, limiting advanced debugging capabilities.
Beyond basic examples, the README lacks detailed guides, API references, or best practices, which could hinder adoption for complex debugging scenarios.