Skip to content

Commit

Permalink
Merge pull request #902 from go-kivik/getatt2
Browse files Browse the repository at this point in the history
Fix nil pointer dereference in example
  • Loading branch information
flimzy authored Mar 8, 2024
2 parents 8c2c4aa + e721e66 commit 4c9573c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion errors_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func ExampleHTTPStatus() {
panic(err)
}
row := client.DB("foo").Get(context.Background(), "my_doc_id")
switch kivik.HTTPStatus(row.Err()) {
switch err := row.Err(); kivik.HTTPStatus(err) {
case http.StatusNotFound:
return
case http.StatusUnauthorized:
Expand Down

0 comments on commit 4c9573c

Please sign in to comment.