Skip to content

Commit d576418

Browse files
authored
Seeds math/rand in main() for the "memoryless" package (#14)
* Seeds math/rand before calling memoryless package https://pkg.go.dev/math/rand#Seed * Reinstalls ca-certificates before building anything * Runs apt-get using sudo * Uses Focal as dist for Travis, and does apt-get update * Moves apt install to before_script section * Updates to Go 1.16 + uses Travis apt addon * Sets waittime to 3s for unit test of main() * Updates Go to 1.16 in Docker image Also, reinstalls ca-certificates package. * Sets GO111MODULE=auto in Docker build * Adds comment about rand.Seed() is being called. * Enables Go modules.
1 parent 67d68b1 commit d576418

6 files changed

Lines changed: 449 additions & 1 deletion

File tree

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
dist: focal
2+
13
language: go
24

5+
go:
6+
- 1.16
7+
8+
addons:
9+
apt:
10+
update: true
11+
packages: ca-certificates
12+
313
before_script:
414
- go get golang.org/x/tools/cmd/cover
515
- go get github.com/mattn/goveralls

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM golang:1.12 as build
1+
FROM golang:1.16 as build
22
ENV CGO_ENABLED 0
33
COPY . /go/src/github.com/m-lab/nodeinfo
44
WORKDIR /go/src/github.com/m-lab/nodeinfo
5+
RUN apt update && apt reinstall ca-certificates
56
RUN go get \
67
-v \
78
-ldflags "-X github.com/m-lab/go/prometheusx.GitShortCommit=$(git log -1 --format=%h)" \

go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module github.com/m-lab/nodeinfo
2+
3+
go 1.16
4+
5+
require (
6+
github.com/m-lab/go v0.1.45
7+
github.com/prometheus/client_golang v1.11.0
8+
gopkg.in/m-lab/pipe.v3 v3.0.0-20180108231244-604e84f43ee0
9+
)

0 commit comments

Comments
 (0)