mirror of
https://github.com/foomo/gocontentful.git
synced 2025-10-16 12:25:39 +00:00
feat: meta file for generator version
This commit is contained in:
parent
b3410cb437
commit
caeb4c9de1
@ -54,6 +54,7 @@ func generate(filename string, tpl []byte, conf spaceConf) error {
|
|||||||
// generateCode generates API to and value objects for the space
|
// generateCode generates API to and value objects for the space
|
||||||
func generateCode(conf spaceConf) (err error) {
|
func generateCode(conf spaceConf) (err error) {
|
||||||
for file, tpl := range map[string][]byte{
|
for file, tpl := range map[string][]byte{
|
||||||
|
filepath.Join(conf.PackageDir, "meta"+goExt): templates.TemplateMeta,
|
||||||
filepath.Join(conf.PackageDir, "gocontentfulvobase"+goExt): templates.TemplateVoBase,
|
filepath.Join(conf.PackageDir, "gocontentfulvobase"+goExt): templates.TemplateVoBase,
|
||||||
filepath.Join(conf.PackageDir, "gocontentfulvo"+goExt): templates.TemplateVo,
|
filepath.Join(conf.PackageDir, "gocontentfulvo"+goExt): templates.TemplateVo,
|
||||||
filepath.Join(conf.PackageDir, "gocontentfulvolib"+goExt): templates.TemplateVoLib,
|
filepath.Join(conf.PackageDir, "gocontentfulvolib"+goExt): templates.TemplateVoLib,
|
||||||
|
|||||||
2
erm/templates/meta.gotmpl
Normal file
2
erm/templates/meta.gotmpl
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// gocontentful version: {{ .Version }}
|
||||||
|
{{ $cfg := . }}package {{ .PackageName }}
|
||||||
@ -2,6 +2,9 @@ package templates
|
|||||||
|
|
||||||
import _ "embed"
|
import _ "embed"
|
||||||
|
|
||||||
|
//go:embed "meta.gotmpl"
|
||||||
|
var TemplateMeta []byte
|
||||||
|
|
||||||
//go:embed "contentful_vo.gotmpl"
|
//go:embed "contentful_vo.gotmpl"
|
||||||
var TemplateVo []byte
|
var TemplateVo []byte
|
||||||
|
|
||||||
|
|||||||
2
test/testapi/meta.go
Normal file
2
test/testapi/meta.go
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// gocontentful version: latest
|
||||||
|
package testapi
|
||||||
Loading…
Reference in New Issue
Block a user