From b4fb6b0b23df1316f31ccb78cc38eb1f0092c11c Mon Sep 17 00:00:00 2001 From: Billy Zha Date: Fri, 2 Feb 2024 00:55:22 +0800 Subject: [PATCH] fix: remove unwanted newline in attach error (#1265) Signed-off-by: Billy Zha --- cmd/oras/root/attach.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/oras/root/attach.go b/cmd/oras/root/attach.go index 73c19e056..7104596aa 100644 --- a/cmd/oras/root/attach.go +++ b/cmd/oras/root/attach.go @@ -107,11 +107,9 @@ func runAttach(cmd *cobra.Command, opts *attachOptions) error { } if len(opts.FileRefs) == 0 && len(annotations[option.AnnotationManifest]) == 0 { return &oerrors.Error{ - Err: errors.New(`neither file nor annotation provided in the command`), - Usage: fmt.Sprintf("%s %s", cmd.Parent().CommandPath(), cmd.Use), - Recommendation: `To attach to an existing artifact, please provide files - via argument or annotations via flag "--annotation". Run "oras attach -h" - for more options and examples`, + Err: errors.New(`neither file nor annotation provided in the command`), + Usage: fmt.Sprintf("%s %s", cmd.Parent().CommandPath(), cmd.Use), + Recommendation: `To attach to an existing artifact, please provide files via argument or annotations via flag "--annotation". Run "oras attach -h" for more options and examples`, } }