From 007690f15480c5e378c533d1fdcd70663f2820f6 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 3 May 2023 18:00:13 +0000 Subject: [PATCH] test: force constant goversion et al on tests Signed-off-by: Carlos Alexandro Becker --- main_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main_test.go b/main_test.go index d55f601e8..9625b567b 100644 --- a/main_test.go +++ b/main_test.go @@ -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)