diff options
| author | Kaushal Subedi | 2015-10-26 21:04:07 -0600 |
|---|---|---|
| committer | Kaushal Subedi | 2015-10-26 21:04:07 -0600 |
| commit | 392f7ebba51dc01d7d9df0e292b2e8c358c67c35 (patch) | |
| tree | 034f5955a24032276fd5d0da4c0c4cde40a11412 /ast.go | |
| parent | c3aad4d448840ddefcb15fb689ecb69444a9a9f7 (diff) | |
| download | gomove-392f7ebba51dc01d7d9df0e292b2e8c358c67c35.tar.bz2 | |
more refactoring
Diffstat (limited to 'ast.go')
| -rw-r--r-- | ast.go | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -53,7 +53,17 @@ func ProcessFileAST(filePath string, from string, to string) { // Join the path of the import package with the remainder from the old one after removing the old import package 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) + fmt.Println(red + + "Updating import " + + importString + + " from file " + + reset + white + + filePath + + reset + red + + " to " + + reset + white + + replacePackage + + reset) // Remove the old import and replace it with the replacement astutil.DeleteImport(fSet, file, importString) @@ -69,7 +79,11 @@ func ProcessFileAST(filePath string, from string, to string) { printer.Fprint(&outputBuffer, fSet, file) ioutil.WriteFile(filePath, outputBuffer.Bytes(), os.ModePerm) - fmt.Printf(blackOnWhite+"File "+filePath+" saved after %d changes."+reset+"\n", numChanges) + fmt.Printf(blackOnWhite+ + "File "+ + filePath+ + " saved after %d changes."+ + reset+"\n", numChanges) } else { fmt.Println(greenUnderline + "No changes needed on file " + filePath + reset) } |
