21 lines
		
	
	
		
			397 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			397 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package export
 | |
| 
 | |
| import (
 | |
| 	"encoding/json"
 | |
| 	"fmt"
 | |
| )
 | |
| 
 | |
| // PrettyPrint logs exported data to console as pretty printed
 | |
| type PrettyPrint struct{}
 | |
| 
 | |
| // Export logs exported data to console as pretty printed
 | |
| func (*PrettyPrint) Export(exports chan interface{}) {
 | |
| 	for res := range exports {
 | |
| 		dat, err := json.MarshalIndent(res, "", "  ")
 | |
| 		if err != nil {
 | |
| 			continue
 | |
| 		}
 | |
| 		fmt.Println(string(dat))
 | |
| 	}
 | |
| }
 |