From 8e2e833a77e3d758fc8df620c7ce781015484116 Mon Sep 17 00:00:00 2001 From: mzz2017 Date: Sat, 26 Dec 2020 00:55:36 +0800 Subject: [PATCH] docs: annotate --- config/outline.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/outline.go b/config/outline.go index b314924..5636a16 100644 --- a/config/outline.go +++ b/config/outline.go @@ -38,23 +38,29 @@ func (outline Outline) getConfig() ([]byte, error) { for _, f := range tryList { b, err = f() if err != nil { + // try next func + b = nil errs = append(errs, err) continue } if b != nil { + // valid result, break break } } if b != nil { + // valid result return b, nil } if len(errs) > 0 { + // concatenate errors err = errs[0] for i := 1; i < len(errs); i++ { err = fmt.Errorf("%v; %v", err, errs[i]) } return nil, err } + // b and err is both nil, no valid info to get configure return nil, InvalidUpstreamErr }