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

Leading whitespace corrupted #3

Closed
tmm1 opened this issue Dec 1, 2019 · 3 comments
Closed

Leading whitespace corrupted #3

tmm1 opened this issue Dec 1, 2019 · 3 comments

Comments

@tmm1
Copy link

tmm1 commented Dec 1, 2019

        if err := os.Rename(sourceFilename, destinationFilename); err
 != nil {
-               err = fmt.Errorf("Could not move file: %v to %v: %v",
-                       sourceFilename, destinationFilename, err)
+               err = fmt.Errorf("Could not move file: %v to %v: %w",
+       sourceFilename, destinationFilename, err)
                log.Add("err", err)

@fatih
Copy link
Owner

fatih commented Dec 2, 2019

Thanks, I assume you're meaning that the code is not correctly formatted? This is a valid Go code though. Seems like go/analysis doesn't formatting fixes. I'll ask around whether this is intended or not.

/cc @matloob

@fatih
Copy link
Owner

fatih commented Dec 4, 2019

@matloob is working on a fix that will format source code that are modified with the -fix flag: https://go-review.googlesource.com/c/tools/+/209861

@fatih fatih closed this as completed in 335c959 Jan 13, 2020
@fatih
Copy link
Owner

fatih commented Jan 13, 2020

The latest master includes now the fix. Thank you for your report again. Also released a new version with it: https://github.com/fatih/errwrap/releases/tag/v1.1.0

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

No branches or pull requests

2 participants