mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-26 01:44:17 +00:00
update code for compatibility with Go 1.27
Fix some test expectations and also fix the production code in impersonator.go to make them compatible with both Go 1.27 and also with older versions, e.g. Go 1.26. With these changes, all unit tests pass when run with either Go 1.26 or Go 1.27. Signed-off-by: Ryan Richard <richardry@vmware.com>
This commit is contained in:
@@ -615,8 +615,11 @@ func TestPlog(t *testing.T) {
|
||||
case runtimeVersionSemver.Major == 1 && runtimeVersionSemver.Minor == 21:
|
||||
// Format of string for Go 1.21
|
||||
return "func13.TestPlog.func13.1.func2"
|
||||
case runtimeVersionSemver.Major == 1 && runtimeVersionSemver.Minor >= 27:
|
||||
// Format of string for Go 1.27+
|
||||
return "func13.1.1"
|
||||
case runtimeVersionSemver.Major == 1 && runtimeVersionSemver.Minor >= 22:
|
||||
// Format of string for Go 1.22+
|
||||
// Format of string for Go 1.22 - 1.26
|
||||
return "func13.TestPlog.func13.1.2"
|
||||
default:
|
||||
// Format of string for Go 1.20 and below.
|
||||
|
||||
Reference in New Issue
Block a user