下載 4.0.1 版本的 ZeroMQ 程式碼後解壓到任意目錄。
tar -xzvf zeromq-4.0.1.tar.gz
cd zeromq-4.0.1
./configure --prefix=/usr
make
make install
go get -tags zmq_4_x github.com/alecthomas/gozmq
測試程式
package main
import (
"fmt"
zmq "github.com/alecthomas/gozmq"
"os"
)
func main() {
major, minor, patch := zmq.Version()
fmt.Printf("Current 0MQ version is %d.%d.%d
", major, minor, patch)
os.Exit(0)
}
執行測試程式
$ go run version.go
$ Current 0MQ version is 4.0.1