From 3e7914c624a6a9fed2f7c68bc0e88992700ed7b2 Mon Sep 17 00:00:00 2001 From: Matthias Diester Date: Sat, 22 Jan 2022 21:42:45 +0100 Subject: [PATCH] Fix golangci-lint findings Fix findings by golangci-lint run. --- print_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/print_test.go b/print_test.go index 1e97980..01bc177 100644 --- a/print_test.go +++ b/print_test.go @@ -48,7 +48,8 @@ var _ = Describe("print functions", func() { w.Close() var buf bytes.Buffer - io.Copy(&buf, r) + _, err = io.Copy(&buf, r) + Expect(err).ToNot(HaveOccurred()) return buf.String() } @@ -63,19 +64,19 @@ var _ = Describe("print functions", func() { It("should parse and process markdown style in Print", func() { Expect(captureStdout(func() { - Print("This should be *bold*.") + _, _ = Print("This should be *bold*.") })).To(BeEquivalentTo("This should be \x1b[1mbold\x1b[0m.")) }) It("should parse and process markdown style in Printf", func() { Expect(captureStdout(func() { - Printf("This should be *%s*.", "bold") + _, _ = Printf("This should be *%s*.", "bold") })).To(BeEquivalentTo("This should be \x1b[1mbold\x1b[0m.")) }) It("should parse and process markdown style in Println", func() { Expect(captureStdout(func() { - Println("This should be *bold*.") + _, _ = Println("This should be *bold*.") })).To(BeEquivalentTo("This should be \x1b[1mbold\x1b[0m.\n")) }) }) @@ -99,19 +100,19 @@ var _ = Describe("print functions", func() { }) It("should parse and process markdown style in Fprint", func() { - Fprint(out, "This should be *bold*.") + _, _ = Fprint(out, "This should be *bold*.") out.Flush() Expect(buf.String()).To(BeEquivalentTo("This should be \x1b[1mbold\x1b[0m.")) }) It("should parse and process markdown style in Fprintf", func() { - Fprintf(out, "This should be *%s*.", "bold") + _, _ = Fprintf(out, "This should be *%s*.", "bold") out.Flush() Expect(buf.String()).To(BeEquivalentTo("This should be \x1b[1mbold\x1b[0m.")) }) It("should parse and process markdown style in Fprintln", func() { - Fprintln(out, "This should be *bold*.") + _, _ = Fprintln(out, "This should be *bold*.") out.Flush() Expect(buf.String()).To(BeEquivalentTo("This should be \x1b[1mbold\x1b[0m.\n")) })