PrintObjects prints all the specified objects to stdout.
(objs []*vt.Object)
| 128 | |
| 129 | // PrintObjects prints all the specified objects to stdout. |
| 130 | func (p *Printer) PrintObjects(objs []*vt.Object) error { |
| 131 | list := make([]map[string]interface{}, 0) |
| 132 | for _, obj := range objs { |
| 133 | m := ObjectToMap(obj) |
| 134 | if viper.IsSet("include") || viper.IsSet("exclude") { |
| 135 | m = FilterMap(m, |
| 136 | viper.GetStringSlice("include"), |
| 137 | viper.GetStringSlice("exclude")) |
| 138 | } |
| 139 | if len(m) > 0 { |
| 140 | list = append(list, m) |
| 141 | } |
| 142 | } |
| 143 | if len(list) > 0 { |
| 144 | return p.Print(list) |
| 145 | } |
| 146 | return nil |
| 147 | } |
| 148 | |
| 149 | // PrintObject prints the specified object to stdout. |
| 150 | func (p *Printer) PrintObject(obj *vt.Object) error { |
no test coverage detected