Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucapette committed Feb 27, 2023
1 parent 49e05f4 commit a37acc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ the same name capitalized (example: `int` becomes `Int`).

If the generator name is composed by multiple words joined by dots, then the
function name is again capitalized by the first letter of the word and joined
together (example: `product.name` becomes `Product.Name`).
together (example: `product.name` becomes `ProductName`).

Each generator with [constraints](#constraints) is available in templates as a
function that takes arguments.
Expand Down Expand Up @@ -361,7 +361,7 @@ For example, to display a full name in the format `Lastname Firstname` instead
of `Firstname Lastname`.

```html
{{ printf "%s %s" Name.Last Name.First }}
{{ printf "%s %s" NameLast NameFirst }}
```

## Completion
Expand Down
2 changes: 1 addition & 1 deletion pkg/fakedata/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func (tf templateFactory) getFunctions() template.FuncMap {
c := cases.Title(language.English)

for _, gen := range tf.factory.generators {
name := strings.Replace(c.String(strings.Replace(gen.Name, ".", " ", -1)), " ", "", -1)
if !gen.IsCustom() {
name := strings.Replace(c.String(strings.Replace(gen.Name, ".", " ", -1)), " ", "", -1)
funcMap[name] = gen.Func
}
}
Expand Down

0 comments on commit a37acc5

Please sign in to comment.