Skip to content

Commit 61aed18

Browse files
authored
Merge pull request #144 from ibm-messaging/modules
Modules
2 parents e06fc39 + 4a95ebc commit 61aed18

30 files changed

+10584
-94
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Changelog
22
Newest updates are at the top of this file.
33

4+
## June 1 2020 - v5.0.0
5+
* Migration for Go modules (requires new major number) (#138)
6+
* ibmmq - Add all string mapping functions from cmqstrc (#142)
7+
* ibmmq - Add AIX platform header
8+
* mqmetric - Permit selection of which statistics to gather for STATQ (ibm-messaging/mq-metric-samples#34)
9+
* mqmetric - Do not try to subscribe to application resource statistics (STATAPP) for now
10+
* mqmetric - Add QFile usage status available from MQ 9.1.5
11+
412
## Apr 02 2020 - v4.1.4
513
* Update for MQ 9.1.5
614
* ibmmq - Add message and header compression for MQCD (#137)

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG BASE_IMAGE=ubuntu:19.04
15+
ARG BASE_IMAGE=ubuntu:19.10
1616
FROM $BASE_IMAGE
1717

1818
ARG GOPATH_ARG="/go"
1919

20-
ENV GOVERSION=1.12 \
20+
ENV GOVERSION=1.13 \
2121
GOPATH=$GOPATH_ARG \
2222
ORG="github.com/ibm-messaging"
2323

README.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
This repository demonstrates how you can call IBM MQ from applications written in the Go language.
44

5-
> **NOTICE**: Please ensure that you use a dependency management tool such as [dep](https://github.com/golang/dep) or [Glide](http://glide.sh/), and add a specific version dependency.
6-
7-
This repository previously contained sample programs that exported MQ statistics to
5+
This repository previously contained programs that exported MQ statistics to
86
some monitoring packages. These have now been moved to a
97
[GitHub repository called mq-metric-samples](https://github.com/ibm-messaging/mq-metric-samples).
108

@@ -56,8 +54,7 @@ but subsequent steps are independent of the platform.
5654
### Linux
5755

5856
* Install the Go runtime and compiler. On Linux, the packaging may vary but a typical
59-
directory for the code is `/usr/lib/golang`.
60-
The compiler should be at least version 10. If you see an error similar to "ld: NULL not defined"
57+
directory for the code is `/usr/lib/golang`. If you see an error similar to "ld: NULL not defined"
6158
when building a program then it is likely you need to upgrade your compiler.
6259

6360

@@ -70,7 +67,7 @@ when building a program then it is likely you need to upgrade your compiler.
7067
export GOPATH=$HOME/gowork
7168
```
7269

73-
* On Linux, you must set environment variables to permit some compile/link flags. This is due to a security fix in the compiler.
70+
* On Linux, some versions of the compiler have required that you set environment variables to permit some compile/link flags. Recent versions of Go seem to effectively include this fix in the compiler so that the export is no longer necessary.
7471

7572
```
7673
export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"
@@ -123,7 +120,7 @@ For example,
123120
```
124121

125122
* Compile the `ibmmq` component:
126-
123+
*
127124
`go install ./src/github.com/ibm-messaging/mq-golang/ibmmq`
128125

129126
* If you plan to use monitoring functions, then compile the `mqmetric` component:
@@ -137,8 +134,42 @@ For example,
137134
At this point, you should have a compiled copy of the program in `$GOPATH/bin`. See the
138135
`samples` directory for more sample programs.
139136

137+
## Building in a container
140138
The `buildSamples.sh` script in this directory can also be used to create a container which will
141-
compile the samples and copy them to a local directory.
139+
compile the samples and copy them to a local directory. If you use this approach, you do not need
140+
to install a local copy of the compiler and associated toold, though you will still need a copy of
141+
the MQ runtime libraries for wherever you execute the programs.
142+
143+
## Go Modules
144+
The packages in this repository are now set up to be used as Go modules. See the `go.mod` file in
145+
the root of the repository. This required a major version bump in the release stream.
146+
147+
Support for modules started to be introduced around Go 1.11 and has been firmed up in various
148+
modification level updates in each of the compiler levels since then. The module changes for this
149+
package were developed and tested with Go 1.13.6.
150+
151+
To use the MQ module in your application, your `go.mod` file contains
152+
153+
```
154+
require (
155+
github.com/ibm-messaging/mq-golang/v5 v5.0.0
156+
)
157+
```
158+
159+
and your application code will include
160+
161+
```
162+
import ibmmq "github.com/ibm-messaging/mq-golang/v5/ibmmq"
163+
```
164+
165+
If you have not moved to using modules in your application, you should continue using the older levels
166+
of these packages. For example, you can continue to use `dep` with `Gopkg.toml` referring to
167+
168+
```
169+
[[constraint]]
170+
name = "github.com/ibm-messaging/mq-golang"
171+
version = "4.1.4"
172+
```
142173

143174
## Related Projects
144175

@@ -185,4 +216,4 @@ in the CLA.
185216

186217
## Copyright
187218

188-
© Copyright IBM Corporation 2016, 2019
219+
© Copyright IBM Corporation 2016, 2020

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/ibm-messaging/mq-golang
1+
module github.com/ibm-messaging/mq-golang/v5
22

33
go 1.13

0 commit comments

Comments
 (0)