From 2be2c1168085e0234a0cf06dab93b6d763bf3f7d Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 2 May 2019 22:25:54 -0700 Subject: Linting more (and fixing more) Signed-off-by: Dave Henderson --- template.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'template.go') diff --git a/template.go b/template.go index 7022664b..f2a021c7 100644 --- a/template.go +++ b/template.go @@ -103,8 +103,9 @@ func gatherTemplates(o *Config, outFileNamer func(string) (string, error)) (temp return nil, err } + switch { // the arg-provided input string gets a special name - if o.Input != "" { + case o.Input != "": templates = []*tplate{{ name: "", contents: o.Input, @@ -112,13 +113,13 @@ func gatherTemplates(o *Config, outFileNamer func(string) (string, error)) (temp modeOverride: modeOverride, targetPath: o.OutputFiles[0], }} - } else if o.InputDir != "" { + case o.InputDir != "": // input dirs presume output dirs are set too templates, err = walkDir(o.InputDir, outFileNamer, o.ExcludeGlob, mode, modeOverride) if err != nil { return nil, err } - } else if o.Input == "" { + case o.Input == "": templates = make([]*tplate, len(o.InputFiles)) for i := range o.InputFiles { templates[i], err = fileToTemplates(o.InputFiles[i], o.OutputFiles[i], mode, modeOverride) -- cgit v1.2.3