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 --- services/attachment/attachment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/attachment') diff --git a/services/attachment/attachment.go b/services/attachment/attachment.go index cce36206a7..557cc808a3 100644 --- a/services/attachment/attachment.go +++ b/services/attachment/attachment.go @@ -29,7 +29,7 @@ func NewAttachment(attach *repo_model.Attachment, file io.Reader) (*repo_model.A attach.UUID = uuid.New().String() size, err := storage.Attachments.Save(attach.RelativePath(), file, -1) if err != nil { - return fmt.Errorf("Create: %v", err) + return fmt.Errorf("Create: %w", err) } attach.Size = size -- cgit v1.2.3