Skip to content

Commit

Permalink
Update README.md: removes faker import confusion (#124)
Browse files Browse the repository at this point in the history
creating both a variable and import name `faker` is confusing and lead me wondering where the docs where for these functions like `.Person()`

Took some careful inspection to realize you're hiding the faker import with a faker variable.

Consider this change set to make it more legible and clear about what is going on.
  • Loading branch information
MaerF0x0 committed Sep 30, 2022
1 parent 56db629 commit d9e5b3b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -40,26 +40,26 @@ Use `faker.New()` to create and initialize a faker generator, which can generate
import "github.com/jaswdr/faker"

func main() {
faker := faker.New()
fake := faker.New()

faker.Person().Name()
fake.Person().Name()
// Lucy Cechtelar

faker.Address().Address()
fake.Address().Address()
// 426 Jordy Lodge

faker.Lorem().Text(100)
fake.Lorem().Text(100)
// Dolores sit sint laboriosam dolorem culpa et autem. Beatae nam sunt fugit
// et sit et mollitia sed.
// Fuga deserunt tempora facere magni omnis. Omnis quia temporibus laudantium
// sit minima sint.
}
```

Even if this example shows a method access, each call to `faker.Name()` yields a different (random) result.
Even if this example shows a method access, each call to `fake.Name()` yields a different (random) result.

```go
p := faker.Person()
p := fake.Person()

for i:=0; i < 10; i++ {
fmt.Println(p.Name())
Expand Down

0 comments on commit d9e5b3b

Please sign in to comment.