diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-07-24 14:40:22 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-07-24 14:40:22 +0300 |
| commit | b0d199936b546c75d4b19d99591237f0bf97fe55 (patch) | |
| tree | e9391880e7db2bd1ea8ff25d91aeea8dd98f186e /backend/parser/parser.go | |
| parent | fix/frontend: fixed sidebar title size, removed unnecessary imports (diff) | |
| parent | feat/backend: add newrelic integration (#274) (diff) | |
| download | lphub-b0d199936b546c75d4b19d99591237f0bf97fe55.tar.gz lphub-b0d199936b546c75d4b19d99591237f0bf97fe55.tar.bz2 lphub-b0d199936b546c75d4b19d99591237f0bf97fe55.zip | |
Merge branch 'main' into css-overhaulcss-overhaul
Diffstat (limited to 'backend/parser/parser.go')
| -rw-r--r-- | backend/parser/parser.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/backend/parser/parser.go b/backend/parser/parser.go index 19cd677..e39616c 100644 --- a/backend/parser/parser.go +++ b/backend/parser/parser.go | |||
| @@ -2,8 +2,8 @@ package parser | |||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "errors" | 4 | "errors" |
| 5 | "io" | ||
| 5 | "math" | 6 | "math" |
| 6 | "os" | ||
| 7 | "regexp" | 7 | "regexp" |
| 8 | "strconv" | 8 | "strconv" |
| 9 | "strings" | 9 | "strings" |
| @@ -22,13 +22,9 @@ type Result struct { | |||
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | // Don't try to understand it, feel it. | 24 | // Don't try to understand it, feel it. |
| 25 | func ProcessDemo(filePath string) (Result, error) { | 25 | func ProcessDemo(demoFile io.Reader) (Result, error) { |
| 26 | var result Result | 26 | var result Result |
| 27 | file, err := os.Open(filePath) | 27 | reader := bitreader.NewReader(demoFile, true) |
| 28 | if err != nil { | ||
| 29 | return Result{}, err | ||
| 30 | } | ||
| 31 | reader := bitreader.NewReader(file, true) | ||
| 32 | demoFileStamp := reader.TryReadString() | 28 | demoFileStamp := reader.TryReadString() |
| 33 | demoProtocol := reader.TryReadSInt32() | 29 | demoProtocol := reader.TryReadSInt32() |
| 34 | networkProtocol := reader.TryReadSInt32() | 30 | networkProtocol := reader.TryReadSInt32() |