1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-30 04:50:45 +02:00

test: force constant goversion et al on tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2023-05-03 18:00:13 +00:00
parent f3aa9c79fa
commit 007690f154
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -8,6 +8,10 @@ import (
)
func TestVersion(t *testing.T) {
const goVersion = "go1.20.3"
const compiler = "gc"
const platform = "linux/amd64"
for name, tt := range map[string]struct {
version, commit, date, builtBy string
}{
@ -34,6 +38,9 @@ func TestVersion(t *testing.T) {
tt := tt
t.Run(name, func(t *testing.T) {
v := buildVersion(tt.version, tt.commit, tt.date, tt.builtBy)
v.GoVersion = goVersion
v.Compiler = compiler
v.Platform = platform
out, err := v.JSONString()
require.NoError(t, err)