@@ -94,22 +94,30 @@ func (tr tableRow) toTableData(flags *Flags, isChild bool) []string {
9494 )
9595 }
9696 rowData = append (rowData , formatPercentage (tr .CPUDifference , flags ))
97+
9798 if flags .wide {
98- var str string
99- d := inf.Dec {}
100- d .Round (tr .Recommendations .Memory .AsDec (), 0 , inf .RoundUp )
101- b := d .UnscaledBig ()
102- switch tr .Requests .Memory .Format {
103- case resource .DecimalSI :
104- str = humanize .BigBytes (b , 2 )
105- case resource .BinarySI :
106- str = humanize .BigIBytes (b , 2 )
107- default :
108- str = tr .Recommendations .Memory .String ()
99+ recoStr := tableUnsetCell
100+ if tr .Recommendations .Memory != nil {
101+ d := inf.Dec {}
102+ d .Round (tr .Recommendations .Memory .AsDec (), 0 , inf .RoundUp )
103+ b := d .UnscaledBig ()
104+
105+ if tr .Requests .Memory != nil {
106+ switch tr .Requests .Memory .Format {
107+ case resource .DecimalSI :
108+ recoStr = humanize .BigBytes (b , 2 )
109+ case resource .BinarySI :
110+ recoStr = humanize .BigIBytes (b , 2 )
111+ default :
112+ recoStr = tr .Recommendations .Memory .String ()
113+ }
114+ } else {
115+ recoStr = tr .Recommendations .Memory .String ()
116+ }
109117 }
110118 rowData = append (rowData ,
111119 formatQuantity (tr .Requests .Memory ),
112- str ,
120+ recoStr ,
113121 )
114122 }
115123 rowData = append (rowData , formatPercentage (tr .MemoryDifference , flags ))
0 commit comments