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
8585
8686import (
8787 " fmt"
88+ " log"
8889 " os"
8990
9091 dem " github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
@@ -94,7 +95,7 @@ import (
9495func main () {
9596 f , err := os.Open (" /path/to/demo.dem" )
9697 if err != nil {
97- panic ( err)
98+ log. Panic ( " failed to open demo file: " , err)
9899 }
99100 defer f.Close ()
100101
@@ -117,7 +118,7 @@ func main() {
117118 // Parse to end
118119 err = p.ParseToEnd ()
119120 if err != nil {
120- panic ( err)
121+ log. Panic ( " failed to parse demo: " , err)
121122 }
122123}
123124```
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package demoinfocs_test
22
33import (
44 "fmt"
5+ "log"
56 "os"
67 "testing"
78
@@ -14,9 +15,9 @@ This will print all kills of a demo in the format '[[killer]] <[[weapon]] [(HS)]
1415*/
1516//noinspection GoUnhandledErrorResult
1617func ExampleParser () {
17- f , err := os .Open ("../../test/cs-demos/default.dem " )
18+ f , err := os .Open ("../../test/cs-demos/default.demx " )
1819 if err != nil {
19- panic ( err )
20+ log . Panic ( "failed to open demo file: " , err )
2021 }
2122
2223 defer f .Close ()
@@ -42,7 +43,7 @@ func ExampleParser() {
4243 // Parse to end
4344 err = p .ParseToEnd ()
4445 if err != nil {
45- panic ( err )
46+ log . Panic ( "failed to parse demo: " , err )
4647 }
4748}
4849
You can’t perform that action at this time.
0 commit comments