Skip to content

Commit

Permalink
Merge pull request #1 from prgres/chore/expose-funcmap
Browse files Browse the repository at this point in the history
chore: expose FuncMap
  • Loading branch information
prgres authored Jul 1, 2024
2 parents ed3e5d4 + 744bc46 commit b636197
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions template.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
var (
//go:embed template
templateDir embed.FS
// funcMap contains extra template functions used by ogent.
funcMap = template.FuncMap{
// FuncMap contains extra template functions used by ogent.
FuncMap = template.FuncMap{
"convertTo": convertTo,
"eagerLoad": eagerLoad,
"edgeOperations": entoas.EdgeOperations,
Expand All @@ -43,7 +43,7 @@ var (
"viewNameEdge": entoas.ViewNameEdge,
}
// templates holds all templates used by ogent.
templates = gen.MustParse(gen.NewTemplate("ogent").Funcs(funcMap).ParseFS(templateDir, "template/*tmpl"))
templates = gen.MustParse(gen.NewTemplate("ogent").Funcs(FuncMap).ParseFS(templateDir, "template/*tmpl"))
)

// eagerLoad returns the Go expression to eager load the required edges on the node operation.
Expand Down

0 comments on commit b636197

Please sign in to comment.