Skip to content

Commit 5045934

Browse files
Merge pull request #1 from filipecosta90/go.mod
Rely on Go Modules to ensure package dependencies and replicable builds. Testing go version 1.11 to 1.15
2 parents eca259f + 8773131 commit 5045934

File tree

6 files changed

+65
-3
lines changed

6 files changed

+65
-3
lines changed

.github/workflows/unit-tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on: [push, pull_request]
2+
name: Test
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
go-version: [1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x]
8+
os: [ubuntu-latest, macos-latest, windows-latest]
9+
runs-on: ${{ matrix.os }}
10+
steps:
11+
- name: Install Go
12+
uses: actions/setup-go@v2
13+
with:
14+
go-version: ${{ matrix.go-version }}
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
- name: Test
18+
run: make test

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Go parameters
2+
GOCMD=GO111MODULE=on go
3+
GOBUILD=$(GOCMD) build
4+
GOINSTALL=$(GOCMD) install
5+
GOCLEAN=$(GOCMD) clean
6+
GOTEST=$(GOCMD) test
7+
GOGET=$(GOCMD) get
8+
GOMOD=$(GOCMD) mod
9+
GOFMT=$(GOCMD) fmt
10+
11+
.PHONY: all test coverage
12+
all: test coverage build
13+
14+
build:
15+
$(GOBUILD) .
16+
17+
get:
18+
$(GOGET) -t -v ./...
19+
20+
fmt:
21+
$(GOFMT) ./...
22+
23+
test: get fmt
24+
$(GOTEST) -count=1 ./...
25+
26+
coverage: get test
27+
$(GOTEST) -race -coverprofile=coverage.txt -covermode=atomic .
28+

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ The easiest way to get and install the Subscriber Go program is to use
1818
# Fetch this repo
1919
go get github.com/filipecosta90/pubsub-sub-bench
2020
cd $GOPATH/src/github.com/filipecosta90/pubsub-sub-bench
21-
go get ./...
22-
go build .
21+
make
2322
```
2423

2524
## Usage of pubsub-sub-bench

go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/filipecosta90/pubsub-sub-bench
2+
3+
go 1.13
4+
5+
require (
6+
github.com/HdrHistogram/hdrhistogram-go v0.0.0-20200919145931-8dac23c8dac1 // indirect
7+
github.com/mediocregopher/radix/v3 v3.5.2
8+
)

go.sum

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
github.com/HdrHistogram/hdrhistogram-go v0.0.0-20200919145931-8dac23c8dac1 h1:nEjGZtKHMK92888VT6XkzKwyiW14v5FFRGeWq2uV7N0=
2+
github.com/HdrHistogram/hdrhistogram-go v0.0.0-20200919145931-8dac23c8dac1/go.mod h1:nxrse8/Tzg2tg3DZcZjm6qEclQKK70g0KxO61gFFZD4=
3+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4+
github.com/mediocregopher/radix/v3 v3.5.2 h1:A9u3G7n4+fWmDZ2ZDHtlK+cZl4q55T+7RjKjR0/MAdk=
5+
github.com/mediocregopher/radix/v3 v3.5.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
6+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
7+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
8+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
9+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

subscriber.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"encoding/json"
55
"flag"
66
"fmt"
7-
"github.com/mediocregopher/radix"
7+
"github.com/mediocregopher/radix/v3"
88
"io/ioutil"
99
"log"
1010
"os"

0 commit comments

Comments
 (0)