Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
glossd committed Oct 20, 2024
1 parent bd29b63 commit 509e153
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ j, err := fetch.Unmarshal[fetch.J](`{
]
}`)
if err != nil {
panic(err)
panic(err)
}

fmt.Println("Print the whole json:", j)
Expand Down Expand Up @@ -213,7 +213,7 @@ n, ok := j.Q(".price").AsNumber()
if !ok {
// not a number
}
fmt.Printf("Price: %f\n", n) // n is a float64
fmt.Printf("Price: %.2f\n", n) // n is a float64
```

`fetch.J` is only `nil` when an error happens. Use `IsNil` to check the value on presence.
Expand Down

0 comments on commit 509e153

Please sign in to comment.