Skip to content

Commit e79ec89

Browse files
committed
code simplification
1 parent da515ec commit e79ec89

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmds/jsonmunge/jsonmunge.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ This would yield
6161
generateMarkdownDocs bool
6262
quiet bool
6363
newLine bool
64-
eol string
6564

6665
// Application Specific Options
6766
templateExpr string
@@ -131,9 +130,6 @@ func main() {
131130
fmt.Fprintln(app.Out, app.Version())
132131
os.Exit(0)
133132
}
134-
if newLine {
135-
eol = "\n"
136-
}
137133

138134
if len(args) == 0 && templateExpr == "" {
139135
cli.ExitOnError(app.Eout, fmt.Errorf("Need to provide at least one template name"), quiet)
@@ -163,5 +159,7 @@ func main() {
163159
// Execute template with data
164160
err = tmpl.Execute(app.Out, data)
165161
cli.ExitOnError(app.Eout, err, quiet)
166-
fmt.Fprintf(app.Out, "%s", eol)
162+
if newLine {
163+
fmt.Fprintln(app.Out, "")
164+
}
167165
}

0 commit comments

Comments
 (0)