aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2014-09-04 17:13:22 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2014-09-04 17:13:22 -0700
commit1a14b5bad8926941023ca310fa3b53c70717b1e2 (patch)
tree417d085886ff79f9bf525c5954b76671c416835f /src/cmd/api
parenta29437101c5c49841d22c0ee6bf8bcd4c7a5c925 (diff)
downloadgo-1a14b5bad8926941023ca310fa3b53c70717b1e2.tar.xz
cmd/api: don't depend on os/user or USER to check api
The -nocgo builder failed because it has cgo disabled as well as no USER environment variable: http://build.golang.org/log/2250abb82f5022b72a12997b8ff89fcdeff094c9 # Checking API compatibility. Error getting current user: user: Current not implemented on linux/amd64 exit status 1 Don't require the environment variable here. LGTM=minux R=dave, adg, minux CC=golang-codereviews https://golang.org/cl/140290043
Diffstat (limited to 'src/cmd/api')
-rw-r--r--src/cmd/api/run.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cmd/api/run.go b/src/cmd/api/run.go
index 896b2b4a1a..c323deb603 100644
--- a/src/cmd/api/run.go
+++ b/src/cmd/api/run.go
@@ -98,11 +98,9 @@ func prepGoPath() string {
if err == nil {
username = u.Username
} else {
- // Only need to handle Unix here, as Windows's os/user uses
- // native syscall and should work fine without cgo.
username = os.Getenv("USER")
if username == "" {
- log.Fatalf("Error getting current user: %v", err)
+ username = "nobody"
}
}