File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ package main
85
85
86
86
import (
87
87
" fmt"
88
+ " log"
88
89
" os"
89
90
90
91
dem " github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
@@ -94,7 +95,7 @@ import (
94
95
func main () {
95
96
f , err := os.Open (" /path/to/demo.dem" )
96
97
if err != nil {
97
- panic ( err)
98
+ log. Panic ( " failed to open demo file: " , err)
98
99
}
99
100
defer f.Close ()
100
101
@@ -117,7 +118,7 @@ func main() {
117
118
// Parse to end
118
119
err = p.ParseToEnd ()
119
120
if err != nil {
120
- panic ( err)
121
+ log. Panic ( " failed to parse demo: " , err)
121
122
}
122
123
}
123
124
```
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package demoinfocs_test
2
2
3
3
import (
4
4
"fmt"
5
+ "log"
5
6
"os"
6
7
"testing"
7
8
@@ -14,9 +15,9 @@ This will print all kills of a demo in the format '[[killer]] <[[weapon]] [(HS)]
14
15
*/
15
16
//noinspection GoUnhandledErrorResult
16
17
func ExampleParser () {
17
- f , err := os .Open ("../../test/cs-demos/default.dem " )
18
+ f , err := os .Open ("../../test/cs-demos/default.demx " )
18
19
if err != nil {
19
- panic ( err )
20
+ log . Panic ( "failed to open demo file: " , err )
20
21
}
21
22
22
23
defer f .Close ()
@@ -42,7 +43,7 @@ func ExampleParser() {
42
43
// Parse to end
43
44
err = p .ParseToEnd ()
44
45
if err != nil {
45
- panic ( err )
46
+ log . Panic ( "failed to parse demo: " , err )
46
47
}
47
48
}
48
49
You can’t perform that action at this time.
0 commit comments