Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change return value and type for UpdateTXTRecord. Fixes #113 #114

Conversation

gfenn-newbury
Copy link
Contributor

@gfenn-newbury gfenn-newbury commented Feb 10, 2021

Fixes #113 by returning the reference to the new object when calling UpdateTXTRecord

}

return &res[0], nil
return ref, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest returning of pointer to the object by updating the reference of the object beforehand.

}

res[0].Text = text

res[0].Zone = "" // set the Zone value to "" as its a non writable field

_, err = objMgr.connector.UpdateObject(&res[0], res[0].Ref)
ref, err := objMgr.connector.UpdateObject(&res[0], res[0].Ref)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference of the object can be updated after this line.
res[0].Ref=ref

@somashekhar
Copy link
Contributor

somashekhar commented May 17, 2021

As a best practice I also support returning pointer to an object after updating its reference.

@somashekhar
Copy link
Contributor

Hi @GNewbury1, do you want to roll back this PR ?

@somashekhar
Copy link
Contributor

Closing this PR as of now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update TXT Record - New object ref is not returned
3 participants