From 370d8c6d3b9ccdf0db551b9c44e777fd0c35cd2c Mon Sep 17 00:00:00 2001 From: Andrew Buss Date: Thu, 10 Dec 2015 00:44:40 -0800 Subject: [PATCH] Ran goimports on the whole project. No functional changes --- client/client.go | 2 +- cmd/ro/gopass/gopass.go | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/client.go b/client/client.go index fceaeea..ccc2c40 100644 --- a/client/client.go +++ b/client/client.go @@ -34,7 +34,7 @@ func NewRemoteServer(serverAddress, CAFile string) (*RemoteServer, error) { } ok := rootCAs.AppendCertsFromPEM(pemBytes) if !ok { - return nil, errors.New("fail to populate CA root pool.") + return nil, errors.New("fail to populate CA root pool") } } diff --git a/cmd/ro/gopass/gopass.go b/cmd/ro/gopass/gopass.go index 2d75406..782aa02 100644 --- a/cmd/ro/gopass/gopass.go +++ b/cmd/ro/gopass/gopass.go @@ -23,21 +23,21 @@ import ( ) const ( - sttyArg0 = "/bin/stty" + sttyArg0 = "/bin/stty" execCwdir = "" ) // Tells the terminal to turn echo off. -var sttyArgvEOff []string = []string{"stty", "-echo"} +var sttyArgvEOff = []string{"stty", "-echo"} // Tells the terminal to turn echo on. -var sttyArgvEOn []string = []string{"stty", "echo"} +var sttyArgvEOn = []string{"stty", "echo"} var ws syscall.WaitStatus // GetPass gets input hidden from the terminal from a user. // This is accomplished by turning off terminal echo, -// reading input from the user and finally turning on terminal echo. +// reading input from the user and finally turning on terminal echo. // prompt is a string to display before the user's input. func GetPass(prompt string) (passwd string, err error) { sig := make(chan os.Signal, 10) @@ -52,7 +52,7 @@ func GetPass(prompt string) (passwd string, err error) { // Setup notifications of termination signals to channel sig, create a process to // watch for these signals so we can turn back on echo if need be. signal.Notify(sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGKILL, syscall.SIGQUIT, - syscall.SIGTERM) + syscall.SIGTERM) go catchSignal(fd, sig, brk) // Turn off the terminal echo. @@ -91,11 +91,11 @@ func echoOff(fd []uintptr) (int, error) { // echoOn turns back on the terminal echo. func echoOn(fd []uintptr) { - // Turn on the terminal echo. - pid, e := syscall.ForkExec(sttyArg0, sttyArgvEOn, &syscall.ProcAttr{Dir: execCwdir, Files: fd}) - if e == nil { - syscall.Wait4(pid, &ws, 0, nil) - } + // Turn on the terminal echo. + pid, e := syscall.ForkExec(sttyArg0, sttyArgvEOn, &syscall.ProcAttr{Dir: execCwdir, Files: fd}) + if e == nil { + syscall.Wait4(pid, &ws, 0, nil) + } } // catchSignal tries to catch SIGKILL, SIGQUIT and SIGINT so that we can turn terminal @@ -108,4 +108,4 @@ func catchSignal(fd []uintptr, sig chan os.Signal, brk chan bool) { os.Exit(-1) case <-brk: } -} \ No newline at end of file +}