Skip to content

Commit 047b5d7

Browse files
author
Joonas Bergius
committed
chore(templates/component): Address linter feedback
Signed-off-by: Joonas Bergius <[email protected]>
1 parent be64887 commit 047b5d7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

templates/component/http-hello-world/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func init() {
1414
}
1515

1616
func handleRequest(w http.ResponseWriter, r *http.Request) {
17-
fmt.Fprintf(w, "Hello from Go!\n")
17+
_, _ = fmt.Fprintf(w, "Hello from Go!\n")
1818
}
1919

2020
// Since we don't run this program like a CLI, the `main` function is empty. Instead,

templates/component/http-hello-world/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ func TestIncomingHandler(t *testing.T) {
4545
if err != nil {
4646
t.Fatalf("failed to read HTTP response body: %s", err)
4747
}
48-
defer resp.Body.Close()
48+
defer func() {
49+
_ = resp.Body.Close()
50+
}()
4951

5052
if want, got := []byte("Hello from Go!\n"), buf; !bytes.Equal(want, got) {
5153
t.Fatalf("unexpected response body: want %q, got %q", want, got)

0 commit comments

Comments
 (0)