Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05689e6f72 |
@@ -5,6 +5,8 @@
|
|||||||
# below are thin shims that call them.
|
# below are thin shims that call them.
|
||||||
.DEFAULT_GOAL := check
|
.DEFAULT_GOAL := check
|
||||||
|
|
||||||
|
VERSION ?= $(shell git describe --tags --always)
|
||||||
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
@script/bootstrap
|
@script/bootstrap
|
||||||
|
|
||||||
@@ -36,13 +38,14 @@ hooks:
|
|||||||
@script/install-precommit
|
@script/install-precommit
|
||||||
|
|
||||||
build:
|
build:
|
||||||
CGO_ENABLED=0 go build -trimpath -o bin/rtnetmon ./cmd/rtnetmon
|
CGO_ENABLED=0 go build -trimpath -ldflags "-X main.Version=$(VERSION)" \
|
||||||
|
-o bin/rtnetmon ./cmd/rtnetmon
|
||||||
|
|
||||||
run: build
|
run: build
|
||||||
./bin/rtnetmon
|
./bin/rtnetmon
|
||||||
|
|
||||||
dev:
|
dev:
|
||||||
go run ./cmd/rtnetmon
|
go run -ldflags "-X main.Version=$(VERSION)" ./cmd/rtnetmon
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
go mod download
|
go mod download
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Version is the git tag or short commit, set at link time with -X by the
|
// Version is the git tag or short commit, set at link time with -X by the
|
||||||
// Dockerfile. Builds that do not set it report dev.
|
// Makefile and the Dockerfile. Builds that do not set it report dev.
|
||||||
var Version = "dev" //nolint:gochecknoglobals // set at link time with -X
|
var Version = "dev" //nolint:gochecknoglobals // set at link time with -X
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user