1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
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
|