You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This prevents having to check the pointer before accessing a relation.
It was already safe to access a nil R's Get() method, but this removes some of the extra typing and nil checks as a convenience.
Previously:
```go
var office *models.Office
if employee != nil {
office = employee.R.GetOffice()
}
```
With this helper:
```go
office := employee.GetOffice()
```
0 commit comments