diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index 7cf5a851978..dd5278f8e74 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -859,6 +859,7 @@ func isTextFile(path string) bool { if err != nil { return false } + defer f.Close(); var buf [1024]byte; n, err := f.Read(&buf);