@@ -130,19 +130,19 @@ func jobInfoCmd(script *testscript.TestScript, _ bool, args []string) {
130130 job := waitForChaincodeJob (script , cfg , cclabel , cchash )
131131
132132 var err error
133- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Job name: %s\n " , job .GetName () )))
133+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Job name: %s\n " , job .GetName ()))
134134 script .Check (err )
135135
136- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Job namespace: %s\n " , job .GetNamespace () )))
136+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Job namespace: %s\n " , job .GetNamespace ()))
137137 script .Check (err )
138138
139139 for k , v := range job .GetLabels () {
140- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Job label: %s=%s\n " , k , v ) ))
140+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Job label: %s=%s\n " , k , v ))
141141 script .Check (err )
142142 }
143143
144144 for k , v := range job .GetAnnotations () {
145- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Job annotation: %s=%s\n " , k , v ) ))
145+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Job annotation: %s=%s\n " , k , v ))
146146 script .Check (err )
147147 }
148148}
@@ -163,36 +163,36 @@ func podInfoCmd(script *testscript.TestScript, _ bool, args []string) {
163163 podname := pod .GetName ()
164164
165165 var err error
166- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Pod name: %s\n " , podname ) ))
166+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Pod name: %s\n " , podname ))
167167 script .Check (err )
168168
169- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Pod namespace: %s\n " , pod .GetNamespace () )))
169+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Pod namespace: %s\n " , pod .GetNamespace ()))
170170 script .Check (err )
171171
172- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Pod service account: %s\n " , pod .Spec .ServiceAccountName ) ))
172+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Pod service account: %s\n " , pod .Spec .ServiceAccountName ))
173173 script .Check (err )
174174
175175 for k , v := range pod .GetLabels () {
176- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Pod label: %s=%s\n " , k , v ) ))
176+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Pod label: %s=%s\n " , k , v ))
177177 script .Check (err )
178178 }
179179
180180 for k , v := range pod .GetAnnotations () {
181- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Pod annotation: %s=%s\n " , k , v ) ))
181+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Pod annotation: %s=%s\n " , k , v ))
182182 script .Check (err )
183183 }
184184
185185 if pod .Spec .Affinity != nil && pod .Spec .Affinity .NodeAffinity .RequiredDuringSchedulingIgnoredDuringExecution != nil {
186186 for _ , t := range pod .Spec .Affinity .NodeAffinity .RequiredDuringSchedulingIgnoredDuringExecution .NodeSelectorTerms {
187187 for _ , e := range t .MatchExpressions {
188- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Pod affinity: %v=%v op=%v\n " , e .Key , e .Values , e .Operator ) ))
188+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Pod affinity: %v=%v op=%v\n " , e .Key , e .Values , e .Operator ))
189189 script .Check (err )
190190 }
191191 }
192192 }
193193
194194 for _ , t := range pod .Spec .Tolerations {
195- _ , err = script .Stdout ().Write ([] byte ( fmt .Sprintf ( "Pod toleration: %v=%v:%v op=%v for %vs\n " , t .Key , t .Value , t .Effect , t .Operator , t .TolerationSeconds ) ))
195+ _ , err = script .Stdout ().Write (fmt .Appendf ( nil , "Pod toleration: %v=%v:%v op=%v for %vs\n " , t .Key , t .Value , t .Effect , t .Operator , t .TolerationSeconds ))
196196 script .Check (err )
197197 }
198198}
0 commit comments