Skip to content

Commit

Permalink
[fix] use NewReader instead of NewScanner
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinRa committed Feb 11, 2025
1 parent 886d9ae commit cccc542
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/runner/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var banner = (`
######## ### ### ### ###
`)

var version = "v1.0.2"
var version = "v1.0.3"

// showBanner is used to show the banner to the user
func showBanner() {
Expand Down
14 changes: 10 additions & 4 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ func Execute(options *types.Options) error {

// Parse File
if options.InputFileMode == "jsonl" {
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := scanner.Text()
reader := bufio.NewReader(file)
for {
line, err := reader.ReadString('\n')
if err != nil {
if err.Error() == "EOF" {
break
}
return errorutil.NewWithErr(err).Msgf("could not read input file")
}

var result output.Result
err := json.Unmarshal([]byte(line), &result)
err = json.Unmarshal([]byte(line), &result)
if err != nil {
return errorutil.NewWithErr(err).Msgf("could not unmarshal input file: %s", options.InputFile)
}
Expand Down

0 comments on commit cccc542

Please sign in to comment.