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 an issue with extra space in unified diff #150

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

SVilgelm
Copy link
Contributor

@SVilgelm SVilgelm commented Mar 12, 2023

The GetUnifiedDiffString returns all lines with an extra character at beginning of each line: +, -, (space).

The code properly handled the + and -, but not handled (space) character at all.
So all changed code got an additional space at the beginning of each line.
This change fixes the issue.

Issue is not critical, because simple go fmt removes that space and this is the reason I didn't catch it earlier.

The GetUnifiedDiffString returns all lines with an extra character at beginning of each line: `+`, `-`, ` ` (space).

The code properly handled the `+` and `-`, but not handled ` ` (space) character at all.
So all changed code got an additional space at the beginning of each line.
This change fixes the issue.

Issue is not critical, because simple `go fmt` removes that space and this is the reason I didn't catch it earlier.

Signed-off-by: Sergey Vilgelm <sergey@vilgelm.com>
Copy link
Owner

@daixiang0 daixiang0 left a comment

Choose a reason for hiding this comment

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

LGTM

@daixiang0 daixiang0 merged commit 15e6842 into daixiang0:master Mar 13, 2023
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.

2 participants