Skip to content

Commit fc387bb

Browse files
committed
Remove unneeded declarations
1 parent 0a8f82c commit fc387bb

File tree

11 files changed

+6
-20
lines changed

11 files changed

+6
-20
lines changed

samples/amqsbo.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import (
4545
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
4646
)
4747

48-
var qMgrObject ibmmq.MQObject
4948
var qObject ibmmq.MQObject
5049

5150
func main() {

samples/amqsdlh.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
3737
)
3838

39-
var qMgrObject ibmmq.MQObject
4039
var qObject ibmmq.MQObject
4140

4241
func main() {

samples/amqsgbr.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import (
4040
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
4141
)
4242

43-
var qMgrObject ibmmq.MQObject
4443
var qObject ibmmq.MQObject
4544

4645
func main() {

samples/amqsget.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import (
4545
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
4646
)
4747

48-
var qMgrObject ibmmq.MQObject
4948
var qObject ibmmq.MQObject
5049

5150
func main() {

samples/amqsinq.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
3636
)
3737

38-
var qMgrObject ibmmq.MQObject
3938
var object ibmmq.MQObject
4039

4140
/*

samples/amqspcf.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
3939
)
4040

41-
var qMgrObject ibmmq.MQObject
4241
var qCommandObject ibmmq.MQObject
4342
var 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.
295294
func 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]

samples/amqsprop.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
4040
)
4141

42-
var qMgrObject ibmmq.MQObject
4342
var qObject ibmmq.MQObject
4443
var putMsgHandle ibmmq.MQMessageHandle
4544
var getMsgHandle ibmmq.MQMessageHandle

samples/amqspub.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
3939
)
4040

41-
var qMgrObject ibmmq.MQObject
4241
var topicObject ibmmq.MQObject
4342

4443
func main() {

samples/amqsput.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import (
4545
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
4646
)
4747

48-
var qMgrObject ibmmq.MQObject
4948
var qObject ibmmq.MQObject
5049

5150
// Main function that simply calls a subfunction to ensure defer routines are called before os.Exit happens

samples/amqsset.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
"github.com/ibm-messaging/mq-golang/v5/ibmmq"
3838
)
3939

40-
var qMgrObject ibmmq.MQObject
4140
var object ibmmq.MQObject
4241

4342
/*

0 commit comments

Comments
 (0)