Skip to content

Commit

Permalink
Trim some lines
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandrone committed Oct 9, 2020
1 parent 5f775f4 commit 6c9b77c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions linelint.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ type Input struct {

func main() {
var flagAutofix bool
flag.BoolVar(&flagAutofix, "a", false, "(autofix) will automatically fix files with errors in place")

flag.BoolVar(
&flagAutofix, "a", false, "(autofix) will automatically fix files with errors in place",
)

flag.Usage = func() {
fmt.Fprintf(os.Stderr, helpMsg, os.Args[0])
Expand Down Expand Up @@ -118,13 +121,17 @@ func processSTDIN(in Input, linters []linter.Linter) error {
_, err = w.Write(fix)

if err != nil {
return fmt.Errorf("[%s] Failed to print fixed input to Stdout: %v\n", rule.GetName(), err)
return fmt.Errorf("[%s] Failed to print fixed input to Stdout: %v\n",
rule.GetName(), err,
)
}

err = w.Flush()

if err != nil {
return fmt.Errorf("[%s] Failed to flush fixed input to Stdout: %v\n", rule.GetName(), err)
return fmt.Errorf("[%s] Failed to flush fixed input to Stdout: %v\n",
rule.GetName(), err,
)
}

lintErrors--
Expand Down Expand Up @@ -156,7 +163,7 @@ func processDirectoryTree(in Input, linters []linter.Linter) error {
if f.IsDir() {
err = filepath.Walk(path, func(p string, info os.FileInfo, err error) error {
if err != nil {
fmt.Printf("Prevent panic by handling failure accessing a path %q: %v\n", p, err)
fmt.Printf("Prevent panic by handling failure accessing %q: %v\n", p, err)
return err
}

Expand Down

0 comments on commit 6c9b77c

Please sign in to comment.