Given a Go source file with a comment at the top of the file (not a package comment):
// Copyright 2022 ...
package main
import (
"cmd/internal/edit"
)
func main() {
_ = edit.Buffer
}
and a patch to modify the imports:
@@
var randomIdentifier identifier
@@
-import "cmd/internal/edit"
+import "github.com/foo/bar/internal/edit"
edit.randomIdentifier
the comment at the top is removed by gopatch, resulting with the following file:
package main
import "github.com/foo/bar/internal/edit"
func main() {
_ = edit.Buffer
}