Description: golang-1.11-src is missing a symlink providing API compatibility
 info (#899298). Add a hardcoded workaround until that bug is fixed.

 This path is debian-specific, hence this patch cannot go upstream.
Author: Martín Ferrari <tincho@debian.org>
Last-Updated: 2019-01-27
Forwarded: no

--- a/godoc/versions.go
+++ b/godoc/versions.go
@@ -202,13 +202,17 @@
 }
 
 func parsePackageAPIInfo() (apiVersions, error) {
-	var apiGlob string
+	var apiPath string
 	if os.Getenv("GOROOT") == "" {
-		apiGlob = filepath.Join(build.Default.GOROOT, "api", "go*.txt")
+		apiPath = filepath.Join(build.Default.GOROOT, "api")
 	} else {
-		apiGlob = filepath.Join(os.Getenv("GOROOT"), "api", "go*.txt")
+		apiPath = filepath.Join(os.Getenv("GOROOT"), "api")
 	}
-
+	// Workaround until Debian bug #899298 is fixed.
+	if _, err := os.Stat(apiPath); err != nil {
+		apiPath = filepath.Join("/", "usr", "share", "go", "api")
+	}
+	apiGlob := filepath.Join(apiPath, "go*.txt")
 	files, err := filepath.Glob(apiGlob)
 	if err != nil {
 		return nil, err
