FilterOutput filters the outputs that get printed first it fills out the Deprecated and Removed booleans then it returns the outputs that are either deprecated or removed and in the component list additionally, if instance.OnlyShowDeprecated is true, it will remove the apiVersions that are deprecate
()
| 154 | // additionally, if instance.OnlyShowDeprecated is true, it will remove the |
| 155 | // apiVersions that are deprecated but not removed |
| 156 | func (instance *Instance) FilterOutput() { |
| 157 | var usableOutputs []*Output |
| 158 | for _, output := range instance.Outputs { |
| 159 | output.Deprecated = output.APIVersion.isDeprecatedIn(instance.TargetVersions) |
| 160 | output.Removed = output.APIVersion.isRemovedIn(instance.TargetVersions) |
| 161 | output.ReplacementAvailable = output.APIVersion.isReplacementAvailableIn(instance.TargetVersions) |
| 162 | switch instance.OnlyShowRemoved { |
| 163 | case false: |
| 164 | if output.Deprecated || output.Removed { |
| 165 | if StringInSlice(output.APIVersion.Component, instance.Components) { |
| 166 | usableOutputs = append(usableOutputs, output) |
| 167 | } |
| 168 | } |
| 169 | case true: |
| 170 | if output.Removed { |
| 171 | if StringInSlice(output.APIVersion.Component, instance.Components) { |
| 172 | usableOutputs = append(usableOutputs, output) |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | instance.Outputs = usableOutputs |
| 178 | } |
| 179 | |
| 180 | // removeDeprecatedOnly is a list replacement operation |
| 181 | func (instance *Instance) tabOut(columns columnList) *tabwriter.Writer { |
no test coverage detected