unix: require GOOS be set in mksyscall

If you don't set GOOS and you try to regenerate
the darwin files, it appears to succeed.
However, because libc was not selected,
it generates broken code.

Change-Id: I20fb4f51dcc539a03b6c6ed03ce39b78d5987d41
Reviewed-on: https://go-review.googlesource.com/c/161719
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/unix/mksyscall.go b/unix/mksyscall.go
index 890652c..e06e425 100644
--- a/unix/mksyscall.go
+++ b/unix/mksyscall.go
@@ -88,6 +88,10 @@
 func main() {
 	// Get the OS and architecture (using GOARCH_TARGET if it exists)
 	goos := os.Getenv("GOOS")
+	if goos == "" {
+		fmt.Fprintln(os.Stderr, "GOOS not defined in environment")
+		os.Exit(1)
+	}
 	goarch := os.Getenv("GOARCH_TARGET")
 	if goarch == "" {
 		goarch = os.Getenv("GOARCH")