Error handling. Vendoring

Signed-off-by: Ettore Dreucci <ettore.dreucci@gmail.com>
This commit is contained in:
2018-06-19 00:26:51 +02:00
parent 0c18f8094e
commit cb07e131d9
322 changed files with 175629 additions and 113 deletions

36
vendor/github.com/dixonwille/wmenu/clearScreen.go generated vendored Normal file
View File

@@ -0,0 +1,36 @@
package wmenu
import (
"os"
"os/exec"
"runtime"
)
var clear map[string]func()
func init() {
clear = make(map[string]func())
clear["linux"] = func() {
cmd := exec.Command("clear")
cmd.Stdout = os.Stdout
cmd.Run()
}
clear["darwin"] = func() {
cmd := exec.Command("clear")
cmd.Stdout = os.Stdout
cmd.Run()
}
clear["windows"] = func() {
cmd := exec.Command("cmd", "/c", "cls")
cmd.Stdout = os.Stdout
cmd.Run()
}
}
//Clear simply clears the command line interface (os.Stdout only).
func Clear() {
value, ok := clear[runtime.GOOS]
if ok {
value()
}
}