aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2019-12-05 00:47:02 +0100
committerTeddy Wing2019-12-05 00:47:02 +0100
commiteaf75cf7b4f188f1b03194432ef6f069214eb5b6 (patch)
treecd7aea9d86e5464ef314521b7cca32b6de39f574
parentffc36e46f311cdb68e2c21e68d2f8ee7b1e0c01a (diff)
downloadgomove-fix-cli-package-compatibility.tar.bz2
Fix `Println` vet warnings to run testsfix-cli-package-compatibility
Was getting the following warnings, causing tests to fail: $ go test ./... # github.com/ksubedi/gomove ./ast.go:67:3: Println arg list ends with redundant newline ./ast.go:73:3: Println arg list ends with redundant newline ./native.go:112:3: Println arg list ends with redundant newline ./native.go:121:3: Println arg list ends with redundant newline FAIL github.com/ksubedi/gomove [build failed] FAIL Since Go 1.10, `go test` runs `vet` checks: https://github.com/golang/go/issues/18085 Update the print calls to eliminate the `vet` warnings.
-rw-r--r--ast.go8
-rw-r--r--native.go8
2 files changed, 8 insertions, 8 deletions
diff --git a/ast.go b/ast.go
index 41ab3df..8ad222a 100644
--- a/ast.go
+++ b/ast.go
@@ -64,14 +64,14 @@ func ProcessFileAST(filePath string, from string, to string) {
}
ioutil.WriteFile(filePath, outputBuffer.Bytes(), os.ModePerm)
- fmt.Println(yellow+
+ fmt.Print(yellow+
"File",
filePath,
"saved",
- reset, "\n\n")
+ reset, "\n\n\n")
} else {
- fmt.Println(yellow+
+ fmt.Print(yellow+
"No changes to write on this file.",
- reset, "\n\n")
+ reset, "\n\n\n")
}
}
diff --git a/native.go b/native.go
index 81ee8c8..af994ee 100644
--- a/native.go
+++ b/native.go
@@ -109,17 +109,17 @@ func ProcessFileNative(filePath string, from string, to string) {
// Only write if changes were made
if numChanges > 0 {
- fmt.Println(yellow+
+ fmt.Print(yellow+
"File",
filePath,
"saved after",
numChanges,
"changes",
- reset, "\n\n")
+ reset, "\n\n\n")
ioutil.WriteFile(filePath, []byte(output), os.ModePerm)
} else {
- fmt.Println(yellow+
+ fmt.Print(yellow+
"No changes to write on this file.",
- reset, "\n\n")
+ reset, "\n\n\n")
}
}