Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bufio.Scanner: token too long #161

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

bd82
Copy link

@bd82 bd82 commented Oct 5, 2021

fixes #162

}

// `err == nil` is used to skip lines which caused an error
if isPrefix == false && err == nil {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition should supposedly allow skipping "invalid" lines.
But I am not sure if such a situation could even exist...
Perhaps I should just return immediately if/when an err is spotted?

@bd82 bd82 force-pushed the read_long_lines branch from 25becca to ef28e68 Compare October 5, 2021 15:44

envMap, err := Read(envFileName)
if err != nil {
t.Error("Error reading file -> " + err.Error() )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bug can be reproduced by reverting the change in godotenv.go and executing this new test.

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.

Lines > 64k cause "bufio.Scanner: token too long"
1 participant