From 4cb8fe32104dd1333c7df72600b18e28c7922b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20St=C3=BCrtz?= Date: Sun, 21 Aug 2016 23:10:28 +0200 Subject: [PATCH] Fixed style hints from hound - no else, when if has a return - Improve Comment on Function --- src/cmds/restic/global.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cmds/restic/global.go b/src/cmds/restic/global.go index 2c14baf9e..898537c31 100644 --- a/src/cmds/restic/global.go +++ b/src/cmds/restic/global.go @@ -83,14 +83,15 @@ func restoreTerminal() { var globalOpts = GlobalOptions{stdout: os.Stdout, stderr: os.Stderr} var parser = flags.NewParser(&globalOpts, flags.HelpFlag|flags.PassDoubleDash) -// Clear Line ASCII sequence is invalid on Windows so ignore it here +// ClearLine creates a platform dependent string to clear the current +// line, so it can be overwritten. ANSI sequences are not supported on +// current windows cmd shell. func ClearLine() string { if runtime.GOOS == "windows" { // Ugly Workaround, write 79 Whitespaces and return return " \r" - } else { - return "\x1b[2K" } + return "\x1b[2K" } // Printf writes the message to the configured stdout stream.