diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1eda015 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.PHONY: test coverage lint vet + +build: + go build +goreleaser: + goreleaser release --snapshot --rm-dis +lint: + go fmt $(go list ./... | grep -v /vendor/) +vet: + go vet $(go list ./... | grep -v /vendor/) +test: + go test -v -cover ./... +coverage: + go test -v -cover -coverprofile=coverage.out ./... &&\ + go tool cover -html=coverage.out -o coverage.html diff --git a/cmd/config.go b/cmd/config.go new file mode 100644 index 0000000..b1f3bbe --- /dev/null +++ b/cmd/config.go @@ -0,0 +1,18 @@ +package cmd + +const License = ` +Copyright (C) 2021 NETWAYS GmbH + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see https://www.gnu.org/licenses/. +` diff --git a/main.go b/main.go index d5aa9ac..4d7705c 100644 --- a/main.go +++ b/main.go @@ -7,9 +7,10 @@ import ( // nolint: gochecknoglobals var ( - version = "0.1.0" - commit = "" - date = "" + // These get filled at build time with the proper vaules + version = "development" + commit = "HEAD" + date = "latest" ) func main() { @@ -28,5 +29,7 @@ func buildVersion() string { result = fmt.Sprintf("%s\ndate: %s", result, date) } + result += "\n" + cmd.License + return result }