Files
routewatch/internal/version/version.go
T
sneak a71be15a07
check / check (push) Waiting to run
Show the MIT licence in the page footers (closes #119)
version.License, which the home and status page footers show, still
said WTFPL after LICENSE and the README moved to MIT. It now says MIT.
A test renders both pages and expects each footer to name MIT and not
WTFPL.

Model: opus-5-5
2026-10-20 01:41:11 +00:00

36 lines
955 B
Go

// Package version provides build version information
package version
// Build-time variables set via ldflags
//
//nolint:gochecknoglobals // variables so that ldflags can set them at build time
var (
// GitRevision is the git commit hash
GitRevision = "unknown"
// GitRevisionShort is the version the page footer shows: the tag or
// short commit hash from `git describe --tags --always`
GitRevisionShort = "unknown"
)
const (
// Name is the program name
Name = "routewatch"
// Author is the program author
Author = "@sneak"
// AuthorURL is the author's website
AuthorURL = "https://sneak.berlin"
// License is the program license, as LICENSE grants it
License = "MIT"
// RepoURL is the git repository URL
RepoURL = "https://git.eeqj.de/sneak/routewatch"
)
// CommitURL returns the URL to view the current commit
func CommitURL() string {
if GitRevision == "unknown" {
return RepoURL
}
return RepoURL + "/commit/" + GitRevision
}