diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2019-05-02 22:25:54 -0700 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2019-05-02 22:28:30 -0700 |
| commit | 2be2c1168085e0234a0cf06dab93b6d763bf3f7d (patch) | |
| tree | 8debeb071f9f246785817c97480edceaba1f4cd5 /template.go | |
| parent | b65e14e1fda1c005a07ec9b98e746ce3d699521a (diff) | |
Linting more (and fixing more)
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'template.go')
| -rw-r--r-- | template.go | 7 |
1 files changed, 4 insertions, 3 deletions
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: "<arg>", 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) |
