From a8d394bfd43039ac09b7e23b3c2996fd935a9a4c Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 13 Jul 2016 11:50:19 -0700 Subject: [PATCH] Don't panic if we hit a dangling symlink in mungedocs --- cmd/mungedocs/mungedocs.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/mungedocs/mungedocs.go b/cmd/mungedocs/mungedocs.go index 9f51d4593fb..ea3683c5238 100644 --- a/cmd/mungedocs/mungedocs.go +++ b/cmd/mungedocs/mungedocs.go @@ -158,6 +158,12 @@ func (f fileProcessor) visit(path string) error { func newWalkFunc(fp *fileProcessor, changesNeeded *bool) filepath.WalkFunc { return func(path string, info os.FileInfo, err error) error { stat, err := os.Stat(path) + if err != nil { + if os.IsNotExist(err) { + return nil + } + return err + } if path != *rootDir && stat.IsDir() && *norecurse { return filepath.SkipDir }