diff --git a/pkg/scp.go b/pkg/scp.go index ea8d5be..f2890f7 100644 --- a/pkg/scp.go +++ b/pkg/scp.go @@ -21,7 +21,7 @@ func CopyToRemote(fileName, remotePath string) error { err := utils.CheckEnvVars(sshHVars) if err != nil { - utils.Error("Error checking environment variables\n: %s", err) + utils.Error("Error checking environment variables: %s", err) os.Exit(1) } @@ -31,9 +31,9 @@ func CopyToRemote(fileName, remotePath string) error { } else { if sshPassword == "" { - return errors.New("SSH_PASSWORD environment variable is required if SSH_IDENTIFY_FILE is empty\n") + return errors.New("SSH_PASSWORD environment variable is required if SSH_IDENTIFY_FILE is empty") } - utils.Warn("Accessing the remote server using password, password is not recommended\n") + utils.Warn("Accessing the remote server using password, password is not recommended") clientConfig, _ = auth.PasswordKey(sshUser, sshPassword, ssh.InsecureIgnoreHostKey()) } @@ -43,7 +43,7 @@ func CopyToRemote(fileName, remotePath string) error { // Connect to the remote server err = client.Connect() if err != nil { - return errors.New("Couldn't establish a connection to the remote server\n") + return errors.New("Couldn't establish a connection to the remote server") } // Open a file @@ -83,7 +83,7 @@ func CopyFromRemote(fileName, remotePath string) error { if sshPassword == "" { return errors.New("SSH_PASSWORD environment variable is required if SSH_IDENTIFY_FILE is empty\n") } - utils.Warn("Accessing the remote server using password, password is not recommended\n") + utils.Warn("Accessing the remote server using password, password is not recommended") clientConfig, _ = auth.PasswordKey(sshUser, sshPassword, ssh.InsecureIgnoreHostKey()) } diff --git a/utils/utils.go b/utils/utils.go index 1eaffad..e53abcd 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -111,7 +111,7 @@ func TestDatabaseConnection() { cmd.Stderr = &out err := cmd.Run() if err != nil { - Error(fmt.Sprintf("Error testing database connection: %v\nOutput: %s\n", err, out.String())) + Error("Error testing database connection: %v\nOutput: %s", err, out.String()) os.Exit(1) } @@ -157,7 +157,7 @@ func GetEnvVariable(envName, oldEnvName string) string { if err != nil { return value } - Warn("%s is deprecated, please use %s instead!\n", oldEnvName, envName) + Warn("%s is deprecated, please use %s instead!", oldEnvName, envName) } }