From b2ace3c1947cbe963f38cf49afb57f456c3da15e Mon Sep 17 00:00:00 2001 From: WANG Xuerui Date: Fri, 5 Aug 2022 12:31:21 +0800 Subject: [PATCH] Add go1.19 Fixes #165. --- platform.go | 7 ++++++- platform_test.go | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/platform.go b/platform.go index 3d4ab71..a398141 100644 --- a/platform.go +++ b/platform.go @@ -178,7 +178,11 @@ var ( // no new platforms in 1.18 Platforms_1_18 = Platforms_1_17 - PlatformsLatest = Platforms_1_18 + Platforms_1_19 = addDrop(Platforms_1_18, []Platform{ + {"linux", "loong64", true}, + }, nil) + + PlatformsLatest = Platforms_1_19 ) // SupportedPlatforms returns the full list of supported platforms for @@ -221,6 +225,7 @@ func SupportedPlatforms(v string) []Platform { {">= 1.16, < 1.17", Platforms_1_16}, {">= 1.17, < 1.18", Platforms_1_17}, {">= 1.18, < 1.19", Platforms_1_18}, + {">= 1.19, < 1.20", Platforms_1_19}, } for _, p := range platforms { diff --git a/platform_test.go b/platform_test.go index 14da569..1771816 100644 --- a/platform_test.go +++ b/platform_test.go @@ -108,10 +108,11 @@ func TestSupportedPlatforms(t *testing.T) { t.Fatalf("bad: %#v", ps) } - ps = SupportedPlatforms("go1.10") - if !reflect.DeepEqual(ps, Platforms_1_10) { + ps = SupportedPlatforms("go1.19") + if !reflect.DeepEqual(ps, Platforms_1_19) { t.Fatalf("bad: %#v", ps) } + // Unknown ps = SupportedPlatforms("foo") if !reflect.DeepEqual(ps, PlatformsLatest) {