aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.go b/main.go
index c757961..cc1c227 100644
--- a/main.go
+++ b/main.go
@@ -155,7 +155,7 @@ func ProcessFileAST(filePath string, from string, to string) {
for _, mPackage := range imports {
for _, mImport := range mPackage {
// Since astutil returns the path string with quotes, remove those
- importString := strings.Replace(mImport.Path.Value, "\"", "", -1)
+ importString := mImport.Path.Value
// If the path matches the oldpath, replace it with the new one
if strings.Contains(importString, from) {
@@ -163,7 +163,7 @@ func ProcessFileAST(filePath string, from string, to string) {
numChanges++
// Join the path of the import package with the remainder from the old one after removing the old import package
- replacePackage := path.Join(to, strings.Replace(importString, from, "", -1))
+ replacePackage := strings.Replace(importString, from, to, -1)
fmt.Println(red + "Updating import " + importString + " from file " + reset + white + filePath + reset + red + " to " + reset + white + replacePackage + reset)