Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,15 @@ 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)

Platforms_1_20 = addDrop(Platforms_1_19, []Platform{
{"freebsd", "riscv64", true},
}, nil)

PlatformsLatest = Platforms_1_20
)

// SupportedPlatforms returns the full list of supported platforms for
Expand Down Expand Up @@ -221,6 +229,8 @@ 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},
{">= 1.20, < 1.21", Platforms_1_20},
}

for _, p := range platforms {
Expand Down
10 changes: 8 additions & 2 deletions platform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,16 @@ 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)
}

ps = SupportedPlatforms("go1.20")
if !reflect.DeepEqual(ps, Platforms_1_20) {
t.Fatalf("bad: %#v", ps)
}

// Unknown
ps = SupportedPlatforms("foo")
if !reflect.DeepEqual(ps, PlatformsLatest) {
Expand Down