Skip to content

Commit

Permalink
chore: fix printf-style issue
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangmingLuo committed Aug 20, 2024
1 parent 3556af1 commit 46cd20f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/xdsresource/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package xdsresource

import (
"errors"
"fmt"
"strings"
)
Expand All @@ -35,17 +36,19 @@ func processUnmarshalErrors(errs []error, errMap map[string]error) error {
}
}

return fmt.Errorf(b.String())
return errors.New(b.String())
}

func combineErrors(errs []error) error {
if len(errs) == 0 {
return nil
}
var b strings.Builder
for _, err := range errs {
for i, err := range errs {
if i > 0 {
b.WriteString("\n")
}
b.WriteString(err.Error())
b.WriteString("\n")
}
return fmt.Errorf(b.String())
return errors.New(b.String())
}

0 comments on commit 46cd20f

Please sign in to comment.