Skip to content

Commit

Permalink
Use reference to record and zone for adding reference to client
Browse files Browse the repository at this point in the history
* Fixes [Bug] Zones and Records have `nil` pointer instead of reference to client #2

Signed-off-by: Marvin A. Ruder <[email protected]>
  • Loading branch information
marvinruder committed Sep 9, 2023
1 parent 67aba98 commit 94963cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ func (c *Client) ZonesByKeyword(ctx context.Context, keyword string) ([]Zone, er
page = root.Meta.Pagination.NextPage
}

for _, z := range zones {
for i := range zones {
z := &zones[i]
z.c = c
}

Expand Down
3 changes: 2 additions & 1 deletion zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ func (z *Zone) Records(ctx context.Context) ([]Record, error) {
page = root.Meta.Pagination.NextPage
}

for _, r := range records {
for i := range records {
r := &records[i]
r.c = z.c
r.zoneID = r.ID
}
Expand Down

0 comments on commit 94963cc

Please sign in to comment.