mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-07 16:55:15 -04:00
constants: make VersionInfo readonly (#1316)
The variable VersionInfo is supposed to be set by `go build -X ...` during link time but should not be modified at runtime. This change ensures the underlying var is private and can only be accessed by a public getter.
This commit is contained in:
parent
0157537852
commit
fc33a74c78
24 changed files with 43 additions and 43 deletions
|
@ -9,7 +9,6 @@ package config
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
@ -39,8 +38,7 @@ func TestValidateVersionCompatibilityHelper(t *testing.T) {
|
|||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
constants.VersionInfo = tc.cli
|
||||
err := validateVersionCompatibilityHelper("Image", tc.target)
|
||||
err := validateVersionCompatibilityHelper(tc.cli, "Image", tc.target)
|
||||
if tc.wantError {
|
||||
assert.Error(err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue