-
Notifications
You must be signed in to change notification settings - Fork 33
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
Changing imports removes comment at the top of a file #54
Comments
The respective
This returns: $ go test .
--- FAIL: TestIntegration (0.04s)
--- FAIL: TestIntegration/replace_import_with_top_level_comment (0.00s)
--- FAIL: TestIntegration/replace_import_with_top_level_comment/comment (0.00s)
e2e_test.go:127:
Error Trace: e2e_test.go:127
Error: Not equal:
expected: "// Copyright 2022 ...\n\npackage main\n\nimport \"github.com/foo/bar/internal/edit\"\n\nfunc main() {\n\t_ = edit.Buffer\n}\n"
actual : "package main\n\nimport \"github.com/foo/bar/internal/edit\"\n\nfunc main() {\n\t_ = edit.Buffer\n}\n"
Diff:
--- Expected
+++ Actual
@@ -1,3 +1 @@
-// Copyright 2022 ...
-
package main
Test: TestIntegration/replace_import_with_top_level_comment/comment
FAIL
FAIL github.com/uber-go/gopatch 0.047s
FAIL |
breml
added a commit
to breml/gopatch
that referenced
this issue
Jun 8, 2022
abhinav
pushed a commit
that referenced
this issue
Jun 8, 2022
abhinav
added a commit
that referenced
this issue
Jul 26, 2022
Prepare a new release of gopatch with a fix for #54. This will release a binary compiled against Go 1.18, so it will be able to parse generics syntax. Verify that we're able to parse generics syntax with two new integration tests.
Merged
abhinav
added a commit
that referenced
this issue
Jul 26, 2022
Prepare a new release of gopatch with a fix for #54. This will release a binary compiled against Go 1.18, so it will be able to parse generics syntax. Verify that we're able to parse generics syntax with two new integration tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given a Go source file with a comment at the top of the file (not a package comment):
and a patch to modify the imports:
the comment at the top is removed by gopatch, resulting with the following file:
The text was updated successfully, but these errors were encountered: