loglogrusgdbGOTRACEBACKSIGABRTloglogrusGODEBUGlogFlags to include source linelog examplelogruslogrus examplego build -gcflags "-N -l" to disable optimizationsgo test -gcflags "-N -l" -c to have Go compile the test, but not run itgdb -d $(go env GOROOT) <your binary>objdump -hreadelf -wGOROOT)list Print next 10 source linesbreakbreak <file.go line> Insert breakpoint in file.go at line linebreak <p.Func> Insert breakpoint at function Func of package pbt Print backtracecontinue Continue to next break pointstep Run until next source linenext Run until next source line in the same stack frameinfo args Show function argumentsinfo locals Show local variablesp <variable> Print variable value<slc>->array[<x>] print element x of slcwhatis <variable> Print type of variableinfo goroutines Print goroutinesgoroutine <n> <cmd> Execute cmd in the context of goroutine n$len() Gets len$cap() Gets capacity$dtype() Get underlying type of interface valueBUILDARGS to -gcflags "-N -l"GOTRACEBACK: Dump stack traces when Go program encounters unrecovered panic or unexpected runtime condition0: no stack traces1: dump user goroutines backtrace (default)2: dump run time and user goroutines backtracecrash: dump user and run time goroutines and crash in OS specific manner (core dump)SIGABRT to a running processgdb -d $(go env GOROOT) -c core <your app>-gcflags "-N -l" to get debugging informationulimit -c to non-zero valueloglogrusgdbGOTRACEBACKSIGABRT| Table of Contents | t |
|---|---|
| Exposé | ESC |
| Full screen slides | e |
| Presenter View | p |
| Source Files | s |
| Slide Numbers | n |
| Toggle screen blanking | b |
| Show/hide slide context | c |
| Notes | 2 |
| Help | h |