Skip to content

Commit 8ce987b

Browse files
docs: rename mg alias to dg in VALIDATOR.md and load example README
Sweep the remaining docs missed in the alias rename so all Go examples use the dg alias for github.com/dgraph-io/dgdao. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8978585 commit 8ce987b

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

VALIDATOR.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ type StructValidator interface {
2020
```go
2121
import (
2222
"github.com/go-playground/validator/v10"
23-
mg "github.com/dgraph-io/dgdao"
23+
dg "github.com/dgraph-io/dgdao"
2424
)
2525

2626
// Create a validator instance (implements StructValidator)
2727
validate := validator.New()
2828

2929
// Create a client with validator
30-
client, err := mg.NewClient("file:///path/to/db", mg.WithValidator(validate))
30+
client, err := dg.NewClient("file:///path/to/db", dg.WithValidator(validate))
3131
if err != nil {
3232
log.Fatal(err)
3333
}
@@ -38,7 +38,7 @@ defer client.Close()
3838

3939
```go
4040
// NewValidator() returns a *validator.Validate with default settings
41-
client, err := mg.NewClient("file:///path/to/db", mg.WithValidator(mg.NewValidator()))
41+
client, err := dg.NewClient("file:///path/to/db", dg.WithValidator(dg.NewValidator()))
4242
```
4343

4444
### Custom Validator Implementation
@@ -53,7 +53,7 @@ func (v *MyValidator) StructCtx(ctx context.Context, s interface{}) error {
5353
return nil
5454
}
5555

56-
client, err := mg.NewClient("file:///path/to/db", mg.WithValidator(&MyValidator{}))
56+
client, err := dg.NewClient("file:///path/to/db", dg.WithValidator(&MyValidator{}))
5757
```
5858

5959
### Struct Validation Tags
@@ -119,7 +119,7 @@ If you don't want validation, simply don't provide a validator:
119119

120120
```go
121121
// No validation will be performed
122-
client, err := mg.NewClient("file:///path/to/db")
122+
client, err := dg.NewClient("file:///path/to/db")
123123
```
124124

125125
## Error Handling

examples/load/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ the same directory:
5454

5555
```go
5656
// Initialize dgdao client with the same directory
57-
client, err := mg.NewClient("file:///path/to/data/directory")
57+
client, err := dg.NewClient("file:///path/to/data/directory")
5858
if err != nil {
5959
// handle error
6060
}

0 commit comments

Comments
 (0)