Fix error handling around exists
This commit is contained in:
parent
23aca7a9ce
commit
f48b041daa
1 changed files with 2 additions and 2 deletions
|
@ -1026,10 +1026,10 @@ you will need to call the `Reload` methods on those yourself.
|
|||
jet, err := models.FindJet(db, 1)
|
||||
|
||||
// Check if the pilot assigned to this jet exists.
|
||||
exists := jet.Pilot(db).Exists()
|
||||
exists, err := jet.Pilot(db).Exists()
|
||||
|
||||
// Check if the pilot with ID 5 exists
|
||||
exists := models.Pilots(db, Where("id=?", 5)).Exists()
|
||||
exists, err := models.Pilots(db, Where("id=?", 5)).Exists()
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
|
Loading…
Reference in a new issue