From 0ebb45cfe7606adf021ad359d6fbfcefc54360a5 Mon Sep 17 00:00:00 2001 From: delvh Date: Mon, 24 Oct 2022 21:29:17 +0200 Subject: Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) Found using `find . -type f -name '*.go' -print -exec vim {} -c ':%s/fmt\.Errorf(\(.*\)%v\(.*\)err/fmt.Errorf(\1%w\2err/g' -c ':wq' \;` Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Andrew Thornton Co-authored-by: wxiaoguang --- modules/options/dynamic.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/options/dynamic.go') diff --git a/modules/options/dynamic.go b/modules/options/dynamic.go index eeef11e8da..3739867580 100644 --- a/modules/options/dynamic.go +++ b/modules/options/dynamic.go @@ -32,12 +32,12 @@ func Dir(name string) ([]string, error) { isDir, err := util.IsDir(customDir) if err != nil { - return []string{}, fmt.Errorf("Unabe to check if custom directory %s is a directory. %v", customDir, err) + return []string{}, fmt.Errorf("Unabe to check if custom directory %s is a directory. %w", customDir, err) } if isDir { files, err := util.StatDir(customDir, true) if err != nil { - return []string{}, fmt.Errorf("Failed to read custom directory. %v", err) + return []string{}, fmt.Errorf("Failed to read custom directory. %w", err) } result = append(result, files...) @@ -47,12 +47,12 @@ func Dir(name string) ([]string, error) { isDir, err = util.IsDir(staticDir) if err != nil { - return []string{}, fmt.Errorf("unable to check if static directory %s is a directory. %v", staticDir, err) + return []string{}, fmt.Errorf("unable to check if static directory %s is a directory. %w", staticDir, err) } if isDir { files, err := util.StatDir(staticDir, true) if err != nil { - return []string{}, fmt.Errorf("Failed to read static directory. %v", err) + return []string{}, fmt.Errorf("Failed to read static directory. %w", err) } result = append(result, files...) -- cgit v1.2.3