Skip to content

Commit ef0dfd6

Browse files
committed
Fix example
1 parent 9a3abd7 commit ef0dfd6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/04-working-with-other-formats/src/app/router.gleam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn handle_request(req: Request) -> Response {
2828
// application it could be XML, protobuf, or anything else.
2929
let result = {
3030
// The GSV library is used to parse the CSV.
31-
use rows <- result.try(gsv.to_lists(body))
31+
use rows <- result.try(gsv.to_lists(body) |> result.replace_error(Nil))
3232

3333
// Get the first row, which is the header row.
3434
use headers <- result.try(list.first(rows))

examples/04-working-with-other-formats/test/app_test.gleam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ pub fn post_successful_test() {
4040

4141
response
4242
|> testing.string_body
43-
|> should.equal("headers,row-count\n\"name,is-cool\",2")
43+
|> should.equal("headers,row-count\n\"name,is-cool\",2\n")
4444
}

0 commit comments

Comments
 (0)