aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mgechev/revive/formatter/ndjson.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mgechev/revive/formatter/ndjson.go')
-rw-r--r--vendor/github.com/mgechev/revive/formatter/ndjson.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/vendor/github.com/mgechev/revive/formatter/ndjson.go b/vendor/github.com/mgechev/revive/formatter/ndjson.go
deleted file mode 100644
index aa2b1d6368..0000000000
--- a/vendor/github.com/mgechev/revive/formatter/ndjson.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package formatter
-
-import (
- "encoding/json"
- "os"
-
- "github.com/mgechev/revive/lint"
-)
-
-// NDJSON is an implementation of the Formatter interface
-// which formats the errors to NDJSON stream.
-type NDJSON struct {
- Metadata lint.FormatterMetadata
-}
-
-// Name returns the name of the formatter
-func (f *NDJSON) Name() string {
- return "ndjson"
-}
-
-// Format formats the failures gotten from the lint.
-func (f *NDJSON) Format(failures <-chan lint.Failure, config lint.Config) (string, error) {
- enc := json.NewEncoder(os.Stdout)
- for failure := range failures {
- obj := jsonObject{}
- obj.Severity = severity(config, failure)
- obj.Failure = failure
- err := enc.Encode(obj)
- if err != nil {
- return "", err
- }
- }
- return "", nil
-}