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

doc/md: fixed wrong sample code for gorm guide #1991

Merged
merged 1 commit into from Aug 16, 2023

Conversation

kylelmh
Copy link
Contributor

@kylelmh kylelmh commented Aug 16, 2023

Background

https://atlasgo.io/guides/orms/gorm has the following sample code:

func main() {
    stmts, err := gormschema.New("mysql", &models.User{}, &models.Pet{}).Load()
    if err != nil {
        fmt.Fprintf(os.Stderr, "failed to load gorm schema: %v\n", err)
        os.Exit(1)
    }
    io.WriteString(os.Stdout, stmts)
}

However, the syntax for gormschema.New only takes String as argument and the provided code would not compile.

Fix

Changed sample code contents to match https://github.com/ariga/atlas-provider-gorm README

@giautm
Copy link
Member

giautm commented Aug 16, 2023

Hey @kylelmh, thank you for submitting the fix. Can you please revert the change for styling and keep the fix only?

changed doc to match atlas-provider-gorm repo

doc/md: fixed formatting
@kylelmh
Copy link
Contributor Author

kylelmh commented Aug 16, 2023

@giautm
Thanks for the comment. I have updated the md so that only one line is affected

@giautm giautm merged commit 162edef into ariga:master Aug 16, 2023
1 check passed
@giautm
Copy link
Member

giautm commented Aug 16, 2023

thank you for your contribution.

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

2 participants