Skip to content

Commit 6d7d72d

Browse files
committed
Remove trailing newlines from responses
1 parent 438e4be commit 6d7d72d

File tree

1 file changed

+2
-2
lines changed
  • projects/output-and-error-handling/server

1 file changed

+2
-2
lines changed

projects/output-and-error-handling/server/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ func main() {
1616
switch randomNumber {
1717
// 50% of the time, we just report the weather. 30% nice, 20% less so.
1818
case 0, 1, 2:
19-
w.Write([]byte("Today it will be sunny!\n"))
19+
w.Write([]byte("Today it will be sunny!"))
2020
case 3, 4:
21-
w.Write([]byte("I'd bring an umbrella, just in case...\n"))
21+
w.Write([]byte("I'd bring an umbrella, just in case..."))
2222
// 30% of the time, we say we're too busy and say try again in a few seconds, in a few different ways.
2323
case 5:
2424
// Generate a random number between 1 and 10, for the number of seconds to tell the client to wait before retrying:

0 commit comments

Comments
 (0)