mirror of
				https://github.com/mgechev/revive.git
				synced 2025-10-30 23:37:49 +02:00 
			
		
		
		
	fix: default formatter generates an extra new line (#1485)
This commit is contained in:
		| @@ -21,8 +21,10 @@ func (*Default) Name() string { | ||||
| // Format formats the failures gotten from the lint. | ||||
| func (*Default) Format(failures <-chan lint.Failure, _ lint.Config) (string, error) { | ||||
| 	var buf bytes.Buffer | ||||
| 	prefix := "" | ||||
| 	for failure := range failures { | ||||
| 		fmt.Fprintf(&buf, "%v: %s\n", failure.Position.Start, failure.Failure) | ||||
| 		fmt.Fprintf(&buf, "%s%v: %s", prefix, failure.Position.Start, failure.Failure) | ||||
| 		prefix = "\n" | ||||
| 	} | ||||
| 	return buf.String(), nil | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user