You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

default.go 585B

1234567891011121314151617181920212223242526
  1. package formatter
  2. import (
  3. "fmt"
  4. "github.com/mgechev/revive/lint"
  5. )
  6. // Default is an implementation of the Formatter interface
  7. // which formats the errors to text.
  8. type Default struct {
  9. Metadata lint.FormatterMetadata
  10. }
  11. // Name returns the name of the formatter
  12. func (f *Default) Name() string {
  13. return "default"
  14. }
  15. // Format formats the failures gotten from the lint.
  16. func (f *Default) Format(failures <-chan lint.Failure, _ lint.Config) (string, error) {
  17. for failure := range failures {
  18. fmt.Printf("%v: %s\n", failure.Position.Start, failure.Failure)
  19. }
  20. return "", nil
  21. }