Skip to content

Commit d3974fc

Browse files
committed
Addresses Pierluca's comments
- use a make file to build - fixes wrong command description
1 parent e9a63e5 commit d3974fc

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
versionFlag="github.com/dedis/d-voting.Version=$(shell git describe --tags)"
2+
timeFlag="github.com/dedis/d-voting.BuildTime=$(shell date +'%d/%m/%y_%H:%M')"
3+
14
lint:
25
# Coding style static check.
36
@go get -v honnef.co/go/tools/cmd/staticcheck
@@ -16,4 +19,7 @@ check: lint vet
1619
go test `go list ./... | grep -v /integration`
1720

1821
test_integration:
19-
go test ./integration
22+
go test ./integration
23+
24+
build:
25+
go build -ldflags="-X $(versionFlag) -X $(timeFlag)" ./cli/memcoin

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ serves those metrics with:
174174
./memcoin --config /tmp/node1 metrics start --addr 127.0.0.1:9100 --path /metrics
175175
```
176176

177-
Build info can be added to the binary with the `ldflags`, at build time.. Infos
177+
Build info can be added to the binary with the `ldflags`, at build time. Infos
178178
are stored on variables in the root `mod.go`. For example:
179179

180180
```sh
@@ -184,3 +184,4 @@ timeFlag="github.com/dedis/d-voting.BuildTime=`date +'%d/%m/%y_%H:%M'`"
184184
go build -ldflags="-X $versionFlag -X $timeFlag" ./cli/memcoin
185185
```
186186

187+
Note that `make build` will do that for you.

metrics/controller/mod.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type controller struct{}
1919
func (m controller) SetCommands(builder node.Builder) {
2020

2121
cmd := builder.SetCommand("metrics")
22-
cmd.SetDescription("interact with the DKG service")
22+
cmd.SetDescription("register Prometheus metrics and servers them via HTTP")
2323

2424
sub := cmd.SetSubCommand("start")
2525
sub.SetDescription("start an http server to server Prometheus metrics")

start_test.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ set -o errexit
77

88
command -v tmux >/dev/null 2>&1 || { echo >&2 "tmux is not on your PATH!"; exit 1; }
99

10-
versionFlag="github.com/dedis/d-voting.Version=`git describe --tags`"
11-
timeFlag="github.com/dedis/d-voting.BuildTime=`date +'%d/%m/%y_%H:%M'`"
12-
13-
go build -ldflags="-X $versionFlag -X $timeFlag" ./cli/memcoin
10+
make build
1411

1512
# Launch session
1613
s="d-voting-test"

0 commit comments

Comments
 (0)