Skip to content

Fix for failed to read input: bufio.Scanner: token too long#27

Open
Nishantbhagat57 wants to merge 1 commit into
tomnomnom:masterfrom
Nishantbhagat57:patch-1
Open

Fix for failed to read input: bufio.Scanner: token too long#27
Nishantbhagat57 wants to merge 1 commit into
tomnomnom:masterfrom
Nishantbhagat57:patch-1

Conversation

@Nishantbhagat57

Copy link
Copy Markdown

Solves failed to read input: bufio.Scanner: token too long

Key changes made

  1. Removed the Scanner-related buffer code
  2. Replaced bufio.Scanner with bufio.Reader
  3. Changed the main loop to use reader.ReadString('\n')
  4. Added proper EOF handling
  5. Added strings.TrimSpace() to handle line endings properly

References

influxdata/influxdb#19586
influxdata/influxdb#19662
sirupsen/logrus#1384
sirupsen/logrus#1370
https://pkg.go.dev/bufio

Solves `failed to read input: bufio.Scanner: token too long`

## Key changes made:
> Removed the Scanner-related buffer code
> Replaced bufio.Scanner with bufio.Reader
> Changed the main loop to use reader.ReadString('\n')
> Added proper EOF handling
> Added strings.TrimSpace() to handle line endings properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant