add params
This commit is contained in:
@@ -2,7 +2,6 @@ package generate
|
||||
|
||||
import "text/template"
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var (
|
||||
tpl = template.Must(template.New("tpls").Parse(baseTemplate))
|
||||
baseTemplate = `// Code generated gitoa.ru/go-4devs/config DO NOT EDIT.
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"gitoa.ru/go-4devs/config/definition"
|
||||
)
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var handlers = sync.Map{}
|
||||
|
||||
func Add(kind string, h Handle) error {
|
||||
|
||||
@@ -73,7 +73,6 @@ func (v View) StructName() string {
|
||||
return generate.FuncName(v.Prefix + v.Name + v.Suffix)
|
||||
}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var (
|
||||
tpl = template.Must(template.New("tpls").Parse(gpoupTemplate))
|
||||
gpoupTemplate = `type {{.StructName}} struct {
|
||||
|
||||
@@ -19,7 +19,6 @@ import (
|
||||
//go:embed tpl/*
|
||||
var tpls embed.FS
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var tpl = template.Must(template.New("tpls").ParseFS(tpls, "tpl/*.tmpl"))
|
||||
|
||||
//nolint:gochecknoinits
|
||||
@@ -141,7 +140,6 @@ func (v View) Parse(valName string, value string, keys []string) string {
|
||||
return data
|
||||
}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var parses = map[string]func(data ParseData) (string, error){
|
||||
typesIntreface[0].Name(): func(data ParseData) (string, error) {
|
||||
var b bytes.Buffer
|
||||
@@ -192,7 +190,6 @@ func internal(data ParseData) (string, error) {
|
||||
return b.String(), nil
|
||||
}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var typesIntreface = [...]reflect.Type{
|
||||
reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem(),
|
||||
reflect.TypeOf((*json.Unmarshaler)(nil)).Elem(),
|
||||
|
||||
@@ -40,7 +40,6 @@ func handle(w io.Writer, data generate.Handler, opt definition.Option) error {
|
||||
return fmt.Errorf("%w:%T", generate.ErrWrongType, opt)
|
||||
}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var (
|
||||
tpl = template.Must(template.New("tpls").Funcs(template.FuncMap{"join": strings.Join}).Parse(templateOption))
|
||||
templateOption = `// read{{.FuncName}} {{.Description}}.
|
||||
|
||||
Reference in New Issue
Block a user