From de81db69fa91b2b54bf7ef9527076e6c1ea170ea Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Tue, 4 Jan 2022 18:24:29 -0300 Subject: [PATCH] interp: use %w on interp.Dir --- interp/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interp/api.go b/interp/api.go index dae43ae04..e93ee5427 100644 --- a/interp/api.go +++ b/interp/api.go @@ -208,18 +208,18 @@ func Dir(path string) RunnerOption { if path == "" { path, err := os.Getwd() if err != nil { - return fmt.Errorf("could not get current dir: %v", err) + return fmt.Errorf("could not get current dir: %w", err) } r.Dir = path return nil } path, err := filepath.Abs(path) if err != nil { - return fmt.Errorf("could not get absolute dir: %v", err) + return fmt.Errorf("could not get absolute dir: %w", err) } info, err := os.Stat(path) if err != nil { - return fmt.Errorf("could not stat: %v", err) + return fmt.Errorf("could not stat: %w", err) } if !info.IsDir() { return fmt.Errorf("%s is not a directory", path)