Use %w instead of %v to format errors

This commit is contained in:
tanjing2020
2021-02-24 09:57:28 +08:00
parent d2b24a664e
commit 61cd099bc1
12 changed files with 23 additions and 22 deletions

View File

@@ -195,7 +195,7 @@ func getPodPreferredNodeAffinity(pod *v1.Pod) (*nodeaffinity.PreferredScheduling
func getPreScoreState(cycleState *framework.CycleState) (*preScoreState, error) {
c, err := cycleState.Read(preScoreStateKey)
if err != nil {
return nil, fmt.Errorf("reading %q from cycleState: %v", preScoreStateKey, err)
return nil, fmt.Errorf("reading %q from cycleState: %w", preScoreStateKey, err)
}
s, ok := c.(*preScoreState)