mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +01:00
Add --version option
* Add flag to display the version for each binary. It is based on `git describe` but adds a number to the PATCH level if we are between annotated tags, so makes it semver.org compatible. Use the "-ldflags" method that also works with go 1.17. * Use Makefile bash and sed magic to do PATCH level increase if needed. Co-authored-by: Bernhard Reiter <bernhard@intevation.de>
This commit is contained in:
parent
de9c2b9663
commit
6fe6907c1d
5 changed files with 57 additions and 6 deletions
|
|
@ -3,8 +3,8 @@
|
|||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2021 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
|
||||
// Software-Engineering: 2021 Intevation GmbH <https://intevation.de>
|
||||
// SPDX-FileCopyrightText: 2022 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
|
||||
// Software-Engineering: 2022 Intevation GmbH <https://intevation.de>
|
||||
|
||||
package util
|
||||
|
||||
|
|
@ -17,6 +17,10 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// SemVersion the version in semver.org format, MUST be overwritten during
|
||||
// the linking stage of the build process
|
||||
var SemVersion = "0.0.0"
|
||||
|
||||
// NWriter is an io.Writer counting the bytes copied through it.
|
||||
type NWriter struct {
|
||||
io.Writer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue