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

Update func comments in chainable_api and FirstOr_ #5935

Merged
merged 1 commit into from Dec 23, 2022

Conversation

naterarmstrong
Copy link
Contributor

@naterarmstrong naterarmstrong commented Dec 23, 2022

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

No code changes, only comments.

Add comments to functions in chainable_api. Depending on the method, these comments add some additional context or details that are relevant when reading the function, link to the actual docs at gorm.io/docs, or provide examples of use. These comments should make GORM much more pleasant to use with an IDE that provides hoverable comments, and are minimal examples.

Also add in-code documentation to FirstOrInit and FirstOrCreate.

Almost all examples are directly pulled from the docs, with short comments explaining the code. Most examples omit the db.Model(&User{}) for brevity, and would not actually work.

User Case Description

As a user using GORM, having small examples and more thorough hover comments allows me to write simple code without having to reference an external website.

Add comments to functions in chainable_api. Depending on the method,
these comments add some additional context or details that are relevant
when reading the function, link to the actual docs at gorm.io/docs, or
provide examples of use. These comments should make GORM much more
pleasant to use with an IDE that provides hoverable comments, and are
minimal examples.

Also add in-code documentation to FirstOrInit and FirstOrCreate.

Almost all examples are directly pulled from the docs, with short
comments explaining the code. Most examples omit the `db.Model(&User{})`
for brevity, and would not actually work.
@jinzhu jinzhu merged commit f3c6fc2 into go-gorm:master Dec 23, 2022
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.

None yet

3 participants