aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-10-27 19:39:25 -0700
committerRuss Cox <rsc@golang.org>2011-10-27 19:39:25 -0700
commit2b0c49f2e56df2b739981ae3e6069f74a776297c (patch)
tree5e85a85d2491349cfa448ef626af7a7ff88449f1
parent7f91a39d3d520d99f988d7060237550f11b6ab18 (diff)
downloadgo-2b0c49f2e56df2b739981ae3e6069f74a776297c.tar.gz
go-2b0c49f2e56df2b739981ae3e6069f74a776297c.zip
go/doc: remove os.NewError anti-heuristic
It will be obsolete when error happens. Submitting this now will make the error transition earlier, at the cost of making a locally-built godoc viewing /pkg/syscall or /pkg/os have some functions appear under the Error type as constructors. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5305067
-rw-r--r--src/pkg/go/doc/doc.go15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/pkg/go/doc/doc.go b/src/pkg/go/doc/doc.go
index c7fed97841..9174864339 100644
--- a/src/pkg/go/doc/doc.go
+++ b/src/pkg/go/doc/doc.go
@@ -175,8 +175,6 @@ func setFunc(table map[string]*ast.FuncDecl, f *ast.FuncDecl) {
}
func (doc *docReader) addFunc(fun *ast.FuncDecl) {
- name := fun.Name.Name
-
// determine if it should be associated with a type
if fun.Recv != nil {
// method
@@ -205,19 +203,6 @@ func (doc *docReader) addFunc(fun *ast.FuncDecl) {
typ := doc.lookupTypeDoc(tname)
if typ != nil {
// named and exported result type
-
- // Work-around for failure of heuristic: In package os
- // too many functions are considered factory functions
- // for the Error type. Eliminate manually for now as
- // this appears to be the only important case in the
- // current library where the heuristic fails.
- if doc.pkgName == "os" && tname == "Error" &&
- name != "NewError" && name != "NewSyscallError" {
- // not a factory function for os.Error
- setFunc(doc.funcs, fun) // treat as ordinary function
- return
- }
-
setFunc(typ.factories, fun)
return
}