Skip to content

Commit

Permalink
docs: annotate
Browse files Browse the repository at this point in the history
  • Loading branch information
mzz2017 committed Dec 25, 2020
1 parent 9e89d32 commit 8e2e833
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/outline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 8e2e833

Please sign in to comment.