go.crypto/ssh/test: improve diagnostics for test failing to get username.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/8817043
This commit is contained in:
David Symonds
2013-04-17 16:22:42 +10:00
parent 62eb5d3fac
commit c7af4ef7d9
+2
View File
@@ -18,6 +18,7 @@ import (
"errors"
"io"
"io/ioutil"
"log"
"net"
"os"
"os/exec"
@@ -79,6 +80,7 @@ func username() string {
} else {
// user.Current() currently requires cgo. If an error is
// returned attempt to get the username from the environment.
log.Printf("user.Current: %v; falling back on $USER", err)
username = os.Getenv("USER")
}
if username == "" {