godoc: default to GOOS/GOARCH js/wasm when rendering syscall/js docs

Otherwise it was just blank. With this CL, this URL should start rendering docs:

   https://tip.golang.org/pkg/syscall/js/

Tested locally.

Change-Id: I2d9b7286f374e9372be372987bb5d12ce5044ce9
Reviewed-on: https://go-review.googlesource.com/121315
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/godoc/server.go b/godoc/server.go
index 9240746..5562da3 100644
--- a/godoc/server.go
+++ b/godoc/server.go
@@ -88,6 +88,14 @@
 		return ioutil.NopCloser(bytes.NewReader(data)), nil
 	}
 
+	// Make the syscall/js package always visible by default.
+	// It defaults to the host's GOOS/GOARCH, and golang.org's
+	// linux/amd64 means the wasm syscall/js package was blank.
+	// And you can't run godoc on js/wasm anyway, so host defaults
+	// don't make sense here.
+	if goos == "" && goarch == "" && relpath == "syscall/js" {
+		goos, goarch = "js", "wasm"
+	}
 	if goos != "" {
 		ctxt.GOOS = goos
 	}