ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/golang/1.22.0/src/cmd/go/testdata/script/mod_get_toolchain.txt
# setup
env TESTGO_VERSION=go1.99rc1
env TESTGO_VERSION_SWITCH=switch

# go get go should use the latest Go 1.23
cp go.mod.orig go.mod
go get go
stderr '^go: upgraded go 1.21 => 1.23.9$'
grep 'go 1.23.9' go.mod
grep 'toolchain go1.99rc1' go.mod

# go get [email protected] should use the latest Go 1.23
cp go.mod.orig go.mod
go get [email protected]
stderr '^go: upgraded go 1.21 => 1.23.9$'
grep 'go 1.23.9' go.mod
grep 'toolchain go1.99rc1' go.mod

# go get [email protected] should use the latest Go 1.22
cp go.mod.orig go.mod
go get [email protected]
stderr '^go: upgraded go 1.21 => 1.22.9$'
grep 'go 1.22.9' go.mod
grep 'toolchain go1.99rc1' go.mod

# go get go@patch should use the latest patch release
go get [email protected]
go get go@patch
stderr '^go: upgraded go 1.22.1 => 1.22.9$'
grep 'go 1.22.9' go.mod
grep 'toolchain go1.99rc1' go.mod

# go get [email protected] does NOT find the release candidate
cp go.mod.orig go.mod
! go get [email protected]
stderr '^go: [email protected]: no matching versions for query "1.24"$'

# go get [email protected] works
cp go.mod.orig go.mod
go get [email protected]
stderr '^go: upgraded go 1.21 => 1.24rc1$'
grep 'go 1.24rc1' go.mod
grep 'toolchain go1.99rc1' go.mod

# go get go@latest finds the latest Go 1.23
cp go.mod.orig go.mod
go get go@latest
stderr '^go: upgraded go 1.21 => 1.23.9$'
grep 'go 1.23.9' go.mod
grep 'toolchain go1.99rc1' go.mod

# Again, with toolchains.

# go get toolchain should find go1.999testmod.
go get toolchain
stderr '^go: upgraded toolchain go1.99rc1 => go1.999testmod$'
grep 'go 1.23.9' go.mod
grep 'toolchain go1.999testmod' go.mod

# go get [email protected] should use the latest Go 1.23
go get [email protected]
stderr '^go: removed toolchain go1.999testmod$'
grep 'go 1.23.9' go.mod
! grep 'toolchain go1.23.9' go.mod  # implied

# go get [email protected] should use the latest Go 1.22 and downgrade go.
go get [email protected]
stderr '^go: downgraded go 1.23.9 => 1.22.9$'
grep 'go 1.22.9' go.mod
! grep 'toolchain go1.22.9' go.mod # implied

# go get toolchain@patch should use the latest patch release
go get [email protected]
go get toolchain@patch
stderr '^go: added toolchain go1.22.9$'
grep 'go 1.22.1' go.mod
grep 'toolchain go1.22.9' go.mod
go get [email protected] toolchain@none
grep 'go 1.22.9' go.mod
! grep 'toolchain go1.22.9' go.mod

# go get [email protected] does NOT find the release candidate
! go get [email protected]
stderr '^go: [email protected]: no matching versions for query "go1.24"$'

# go get [email protected] works
go get [email protected]
stderr '^go: added toolchain go1.24rc1$'
grep 'go 1.22.9' go.mod  # no longer implied
grep 'toolchain go1.24rc1' go.mod

# go get toolchain@latest finds go1.999testmod.
cp go.mod.orig go.mod
go get toolchain@latest
stderr '^go: added toolchain go1.999testmod$'
grep 'go 1.21' go.mod
grep 'toolchain go1.999testmod' go.mod

# Bug fixes.

# go get go@garbage should fail but not crash
! go get go@garbage
! stderr panic
stderr '^go: invalid go version garbage$'

# go get [email protected] is OK - we silently correct to 1.21.0
go get [email protected]
go get [email protected]
stderr '^go: upgraded go 1.19 => 1.21.0'

# go get [email protected] is OK too.
go get [email protected]
stderr '^go: downgraded toolchain go1.999testmod => go1.24rc1$'

# go get [email protected] should work if we are the Go 1.21 language version,
# even though there's no toolchain for it.
# (Older versions resolve to the latest release in that version, so for example
# go get [email protected] might resolve to 1.20.9, but if we're the devel copy of
# Go 1.21, there's no release yet to resolve to, so we resolve to ourselves.)
env TESTGO_VERSION=go1.21
go get [email protected] toolchain@none
go get [email protected]
grep 'go 1.21$' go.mod
! grep toolchain go.mod

-- go.mod.orig --
module m

go 1.21