diff --git a/cmd/gf/internal/cmd/cmd_tpl.go b/cmd/gf/internal/cmd/cmd_tpl.go index 245031394..8ad833df3 100644 --- a/cmd/gf/internal/cmd/cmd_tpl.go +++ b/cmd/gf/internal/cmd/cmd_tpl.go @@ -39,7 +39,7 @@ like json/xml/yaml/toml/ini. cTplParseEg = ` gf tpl parse -p ./template -v values.json -r gf tpl parse -p ./template -v values.json -n *.tpl -r -gf tpl parse -p ./template -v values.json -d '${,}}' -r +gf tpl parse -p ./template -v values.json -d '${{,}}' -r gf tpl parse -p ./template -v values.json -o ./template.parsed ` cTplSupportValuesFilePattern = `*.json,*.xml,*.yaml,*.yml,*.toml,*.ini` @@ -69,7 +69,7 @@ func init() { } func (c *cTpl) Parse(ctx context.Context, in cTplParseInput) (out *cTplParseOutput, err error) { - if in.Output == "" && in.Replace == false { + if in.Output == "" && !in.Replace { return nil, gerror.New(`parameter output and replace should not be both empty`) } delimiters := gstr.SplitAndTrim(in.Delimiters, ",")