diff options
| author | Teddy Wing | 2019-12-05 00:47:02 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2019-12-05 00:47:02 +0100 | 
| commit | eaf75cf7b4f188f1b03194432ef6f069214eb5b6 (patch) | |
| tree | cd7aea9d86e5464ef314521b7cca32b6de39f574 | |
| parent | ffc36e46f311cdb68e2c21e68d2f8ee7b1e0c01a (diff) | |
| download | gomove-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.go | 8 | ||||
| -rw-r--r-- | native.go | 8 | 
2 files changed, 8 insertions, 8 deletions
| @@ -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")  	}  } @@ -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")  	}  } | 
