chore: scaffold the module, tooling and release config
This commit is contained in:
parent
5ed9aff797
commit
704214c6c4
2 changed files with 6133 additions and 0 deletions
18
internal/version/version.go
Normal file
18
internal/version/version.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// Package version holds the version of the motorino binary.
|
||||
//
|
||||
// The release build stamps the value with
|
||||
//
|
||||
// -ldflags "-X git.kmalloc.org/squid/motorino/internal/version.value=1.2.3"
|
||||
//
|
||||
// and an unstamped build reports "dev".
|
||||
package version
|
||||
|
||||
// value is the version stamped by the linker; it stays "dev" for local builds.
|
||||
var value = "dev"
|
||||
|
||||
// String returns the version of this build.
|
||||
func String() string {
|
||||
return value
|
||||
}
|
||||
12
internal/version/version_test.go
Normal file
12
internal/version/version_test.go
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package version
|
||||
|
||||
import "testing"
|
||||
|
||||
// TestString checks that an unstamped build reports the development version.
|
||||
func TestString(t *testing.T) {
|
||||
if got := String(); got != "dev" {
|
||||
t.Fatalf("String() = %q, want %q", got, "dev")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue