Add goctl version to code header (#4293)

This commit is contained in:
kesonan
2024-08-03 22:22:51 +08:00
committed by GitHub
parent dedba17219
commit 64e3aeda55
11 changed files with 28 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
// Code generated by goctl. DO NOT EDIT.
// goctl {{.version}}
{{.componentTypes}}

View File

@@ -8,6 +8,7 @@ import (
"github.com/zeromicro/go-zero/tools/goctl/api/spec"
apiutil "github.com/zeromicro/go-zero/tools/goctl/api/util"
"github.com/zeromicro/go-zero/tools/goctl/internal/version"
"github.com/zeromicro/go-zero/tools/goctl/util/pathx"
)
@@ -61,5 +62,6 @@ func genComponents(dir string, api *spec.ApiSpec) error {
t := template.Must(template.New("componentsTemplate").Parse(componentsTemplate))
return t.Execute(fp, map[string]string{
"componentTypes": val,
"version": version.BuildVersion,
})
}