You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,19 +219,14 @@ If your project is using this library feel free to submit a PR or send a message
219
219
220
220
## Development
221
221
222
-
### Git Hooks
223
-
224
-
To install some (optional, but quite handy) `pre-commit` and `pre-push` hooks, you can run the following script.
222
+
### Debugging
225
223
226
-
scripts/git-hooks/link-git-hooks.sh
224
+
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>
225
+
Side-note: The tag isn't called `debug` to avoid naming conflicts with other libs (and underscores in tags don't work, apparently).
227
226
228
-
#### `pre-commit`:
229
-
- check if [interfaces have been updated](#generating-interfaces)
230
-
- build the code
231
-
- run unit tests
227
+
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.debugServerClasses=YES'`
232
228
233
-
#### `pre-push`:
234
-
- run regression tests
229
+
Check out `debug_on.go` for any other settings that can be changed.
235
230
236
231
### Testing
237
232
@@ -269,15 +264,6 @@ To update it you can run the following command:
269
264
270
265
Please don't update the `.golden` file if you are not sure it's required. Maybe the failing CI is just pointing out a regression.
271
266
272
-
### Debugging
273
-
274
-
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>
275
-
Side-note: The tag isn't called `debug` to avoid naming conflicts with other libs (and underscores in tags don't work, apparently).
276
-
277
-
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.debugServerClasses=YES'`
278
-
279
-
Check out `debug_on.go` for any other settings that can be changed.
280
-
281
267
### Generating Interfaces
282
268
283
269
We generate interfaces such as `GameState` from structs to make it easier to keep docs in synch over structs and interfaces.
@@ -303,6 +289,20 @@ Make sure both are inside your `PATH` variable.
303
289
304
290
After installing these use `go generate ./msg` to generate the protobuf code. If you're on Windows you'll need to run go generate from CMD, not Bash.
305
291
292
+
### Git Hooks
293
+
294
+
To install some (optional, but quite handy) `pre-commit` and `pre-push` hooks, you can run the following script.
295
+
296
+
scripts/git-hooks/link-git-hooks.sh
297
+
298
+
#### `pre-commit`:
299
+
- check if [interfaces have been updated](#generating-interfaces)
300
+
- build the code
301
+
- run unit tests
302
+
303
+
#### `pre-push`:
304
+
- run regression tests
305
+
306
306
## Acknowledgements
307
307
308
308
Thanks to [@JetBrains](https://github.com/JetBrains) for sponsoring a license of their awesome [GoLand](https://www.jetbrains.com/go/) IDE for this project - go check it out!
0 commit comments