Package: golang Version: 2:1-6 Severity: normal Symlink /usr/lib/go/src confuses it. There is already a bug in Go's issue tracker: http://code.google.com/p/go/issues/detail?id=1540 even with a patch. Ondřej promised to apply that patch a year ago but either forgot to do that or it's broken again.
So, I have another patch. I think, it's a little less intrusive. And more general either: with this patch godoc should support symlinks everywhere as if they are normal directories/files. -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (990, 'unstable'), (500, 'stable-updates'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-2-amd64 (SMP w/8 CPU cores) Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages golang depends on: ii golang-doc 2:1-6 ii golang-go 2:1-6 ii golang-src 2:1-6 golang recommends no packages. golang suggests no packages. -- no debconf information
diff -r bad5895b4270 src/cmd/godoc/filesystem.go --- a/src/cmd/godoc/filesystem.go Sat Jan 21 21:31:21 2012 -0800 +++ b/src/cmd/godoc/filesystem.go Thu Apr 19 14:27:33 2012 +0400 @@ -66,5 +66,20 @@ } func (osFS) ReadDir(path string) ([]os.FileInfo, error) { - return ioutil.ReadDir(path) // is sorted + fis, err := ioutil.ReadDir(path) // is sorted + if err != nil { + return nil, err + } + // Replace symlinks with what they are pointing to + dirPrefix := path + "/" + for i, fi := range fis { + if fi.Mode() & os.ModeSymlink != 0 { + fi, err = os.Stat(dirPrefix + fi.Name()) + if err != nil { + return nil, err + } + } + fis[i] = fi + } + return fis, nil }