Merge pull request #62 from cristoper/patch-1

PrettyPrint should conform to Exporter interface
This commit is contained in:
Musab Gultekin 2023-02-20 13:14:02 -05:00 committed by GitHub
commit 555cdee597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ import (
type PrettyPrint struct{} type PrettyPrint struct{}
// Export logs exported data to console as pretty printed // Export logs exported data to console as pretty printed
func (*PrettyPrint) Export(exports chan interface{}) { func (*PrettyPrint) Export(exports chan interface{}) error {
for res := range exports { for res := range exports {
dat, err := json.MarshalIndent(res, "", " ") dat, err := json.MarshalIndent(res, "", " ")
if err != nil { if err != nil {
@ -17,4 +17,5 @@ func (*PrettyPrint) Export(exports chan interface{}) {
} }
fmt.Println(string(dat)) fmt.Println(string(dat))
} }
return nil
} }