Skip to content

Commit

Permalink
Simplify Go code with gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmeuli committed Dec 30, 2019
1 parent 22de6e5 commit 1c42a86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/linters/gofmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ class Gofmt {

// -d: Display diffs instead of rewriting files
// -e: Report all errors (not just the first 10 on different lines)
// -s: Simplify code
// -w: Write result to (source) file instead of stdout
return run(`gofmt ${fix ? "-w" : "-d -e"} "."`, {
return run(`gofmt -s ${fix ? "-w" : "-d -e"} "."`, {
dir,
ignoreErrors: true,
}).stdout;
Expand Down

0 comments on commit 1c42a86

Please sign in to comment.