下載 4.0.1 版本的 ZeroMQ 代碼後解壓到任意目錄。git
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
測試程序github
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\n", major, minor, patch) os.Exit(0) }
運行測試程序bash
$ go run version.go $ Current 0MQ version is 4.0.1