1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:14:47 -07:00

blog: fix swallowed error

A function created for filepath.Walk in the blog package accepts an error
as its third argument, but then does nothing with it. This change picks up
the dropped error and returns it should it be non-nil.

Change-Id: I68786f7f1f2accbe527994e2d3e7b2f3da257a2d
GitHub-Last-Rev: d740e91601833d1033a6b9709a6c333f9dc3c1bc
GitHub-Pull-Request: golang/tools#183
Reviewed-on: https://go-review.googlesource.com/c/tools/+/203884
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Lars Lehtonen 2019-12-18 18:59:00 +00:00 committed by Dmitri Shuralyov
parent d270ebf96e
commit 61f5e7d299

View File

@ -188,6 +188,9 @@ func (s *Server) loadDocs(root string) error {
// Read content into docs field. // Read content into docs field.
const ext = ".article" const ext = ".article"
fn := func(p string, info os.FileInfo, err error) error { fn := func(p string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if filepath.Ext(p) != ext { if filepath.Ext(p) != ext {
return nil return nil
} }