Skip to content

Commit

Permalink
doc/md: fixed wrong sample code for gorm guide
Browse files Browse the repository at this point in the history
changed doc to match atlas-provider-gorm repo
  • Loading branch information
kylelmh committed Aug 16, 2023
1 parent 596ad26 commit 8fe7ff6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions doc/md/guides/orms/gorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,21 @@ Create a new program named `loader/main.go` with the following contents:
package main

import (
"io"
"os"
"io"
"os"

"ariga.io/atlas-provider-gorm/gormschema"
_ "ariga.io/atlas-provider-gorm/recordriver"
"github.com/<yourorg>/<yourrepo>/path/to/models"
"ariga.io/atlas-provider-gorm/gormschema"
_ "ariga.io/atlas-go-sdk/recordriver"
"github.com/<yourorg>/<yourrepo>/path/to/models"
)

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)
stmts, err := gormschema.New("mysql").Load(&models.User{}, &models.Pet{})
if err != nil {
fmt.Fprintf(os.Stderr, "failed to load gorm schema: %v\n", err)
os.Exit(1)
}
io.WriteString(os.Stdout, stmts)
}
```

Expand Down

0 comments on commit 8fe7ff6

Please sign in to comment.