File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
cmd/template-resolver/utils Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ type TemplateResolver struct {
2525}
2626
2727func (t * TemplateResolver ) GetCmd () * cobra.Command {
28- envVarLint := "TEMPLATE_RESOLVER_LINT"
29-
3028 // templateResolverCmd represents the template-resolver command
3129 templateResolverCmd := & cobra.Command {
3230 Use : `template-resolver [flags] [file|-]
@@ -100,20 +98,18 @@ func (t *TemplateResolver) GetCmd() *cobra.Command {
10098 "Handle the input directly as a Go template, skipping any surrounding policy field validations." ,
10199 )
102100
101+ envVarLint := "TEMPLATE_RESOLVER_LINT"
102+ lint := os .Getenv (envVarLint ) == "true"
103+
103104 templateResolverCmd .Flags ().BoolVar (
104105 & t .Lint ,
105106 "lint" ,
106- false ,
107+ lint ,
107108 fmt .Sprintf (
108109 "(Tech Preview) Lint the template string for issues (Alternatively, set the environment variable %s=true)." ,
109110 envVarLint ),
110111 )
111112
112- lint := os .Getenv (envVarLint )
113- if lint == "true" {
114- t .Lint = true
115- }
116-
117113 return templateResolverCmd
118114}
119115
You can’t perform that action at this time.
0 commit comments