Skip to content

Commit 479fc10

Browse files
authored
readme: ldflags example
1 parent f7fb1f5 commit 479fc10

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,11 @@ If your project is using this library feel free to submit a PR or send a message
226226

227227
### Debugging
228228

229-
You can use the build tag `debugdemoinfocs` (i.e. `go test -tags debugdemoinfocs -v`) to print out debugging information - such as game events or unhandled demo-messages - during the parsing process.<br>
229+
You can use the build tag `debugdemoinfocs` (e.g. `go run -tags debugdemoinfocs examples/print-events/print_events.go -demo example.dem`) to print out debugging information - such as game events or unhandled demo-messages - during the parsing process.<br>
230230
Side-note: The tag isn't called `debug` to avoid naming conflicts with other libs (and underscores in tags don't work, apparently).
231231

232-
To change the default debugging behavior, Go's `ldflags` parameter can be used. Example for additionally printing out all server-classes with their properties: `-ldflags="-X 'github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs.debugServerClasses=YES'"`
232+
To change the default debugging behavior, Go's `ldflags` parameter can be used. Example for additionally printing out all server-classes with their properties: `-ldflags="-X 'github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs.debugServerClasses=YES'"`.
233+
e.g. `go run -tags debugdemoinfocs -ldflags="-X 'github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs.debugDemoCommands=YES'" examples/print-events/print_events.go -demo example.dem`
233234

234235
Check out `debug_on.go` for any other settings that can be changed.
235236

0 commit comments

Comments
 (0)