@@ -38,7 +38,6 @@ import (
3838 "github.com/ibm-messaging/mq-golang/v5/ibmmq"
3939)
4040
41- var qMgrObject ibmmq.MQObject
4241var qCommandObject ibmmq.MQObject
4342var qReplyObject ibmmq.MQObject
4443
@@ -288,22 +287,19 @@ func getReplies() error {
288287}
289288
290289// For some of the returned fields, print the name and value.
291- // We are not going to print all of the different types that might be returned
292- // but you can see the pattern. As an additional example, the QueueType field gets
293- // transformed into the string equivalent. The amqsevta.c sample program in the MQ product
294- // has much fuller examples of how to recognise and convert the different elements.
290+ // Only a subset of the possible data types are formatted.
291+ // Integer values are converted, where possible, into their string constant equivalent
292+ // The amqsevta.c sample program in the MQ product has much fuller examples of
293+ // how to recognise and convert the different elements.
295294func printPcfParm (p * ibmmq.PCFParameter ) {
296295 name := ""
297296 val := ""
298297 switch p .Type {
299298 case ibmmq .MQCFT_INTEGER :
300299 name = ibmmq .MQItoString ("MQIA" , int (p .Parameter ))
301300 v := int (p .Int64Value [0 ])
302- if p .Parameter == ibmmq .MQIA_Q_TYPE {
303- val = ibmmq .MQItoString ("MQQT" , v )
304- } else {
305- val = fmt .Sprintf ("%d" , v )
306- }
301+ val = ibmmq .PCFValueToString (p .Parameter , int64 (v ))
302+
307303 case ibmmq .MQCFT_STRING :
308304 name = ibmmq .MQItoString ("MQCA" , int (p .Parameter ))
309305 val = p .String [0 ]
0 commit comments