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_import_toolchain.txt
# This test verifies that 'go get' and 'go mod tidy' switch to a newer toolchain
# if needed to process newly-reolved imports.

env TESTGO_VERSION=go1.21.0
env TESTGO_VERSION_SWITCH=switch

cp go.mod go.mod.orig

# tidy reports needing 1.22.0 for b1
env GOTOOLCHAIN=local
! go mod tidy
stderr '^go: example imports\n\texample.net/b: module ./b1 requires go >= 1.22.0 \(running go 1.21.0; GOTOOLCHAIN=local\)$'
env GOTOOLCHAIN=auto
go mod tidy

cmp stderr tidy-stderr.want
cmp go.mod go.mod.tidy

cp go.mod.orig go.mod
env GOTOOLCHAIN=local
! go get -v .
stderr '^go: example.net/[email protected]: module ./b1 requires go >= 1.22.0 \(running go 1.21.0; GOTOOLCHAIN=local\)$'
env GOTOOLCHAIN=auto
go get -v .
cmp stderr get-v-stderr.want
cmp go.mod go.mod.tidy

cp go.mod.orig go.mod
env GOTOOLCHAIN=local
! go get -u -v .
stderr '^go: example.net/[email protected]: module ./a2 requires go >= 1.22.0 \(running go 1.21.0; GOTOOLCHAIN=local\)$'
env GOTOOLCHAIN=auto
go get -u -v .
cmp stderr get-u-v-stderr.want
cmp go.mod go.mod.upgraded

-- tidy-stderr.want --
go: found example.net/b in example.net/b v0.1.0
go: module ./b1 requires go >= 1.22.0; switching to go1.22.9
go: found example.net/b in example.net/b v0.1.0
go: found example.net/c in example.net/c v0.1.0
-- get-v-stderr.want --
go: trying upgrade to example.net/[email protected]
go: module ./b1 requires go >= 1.22.0; switching to go1.22.9
go: trying upgrade to example.net/[email protected]
go: accepting indirect upgrade from [email protected] to 1.22.0
go: trying upgrade to example.net/[email protected]
go: upgraded go 1.20 => 1.22.0
go: added toolchain go1.22.9
go: added example.net/b v0.1.0
go: added example.net/c v0.1.0
go: added example.net/d v0.1.0
-- get-u-v-stderr.want --
go: trying upgrade to example.net/[email protected]
go: trying upgrade to example.net/[email protected]
go: module ./a2 requires go >= 1.22.0; switching to go1.22.9
go: trying upgrade to example.net/[email protected]
go: trying upgrade to example.net/[email protected]
go: accepting indirect upgrade from [email protected] to 1.22.0
go: trying upgrade to example.net/[email protected]
go: trying upgrade to example.net/[email protected]
go: module ./d2 requires go >= 1.23.0; switching to go1.23.9
go: trying upgrade to example.net/[email protected]
go: trying upgrade to example.net/[email protected]
go: accepting indirect upgrade from [email protected] to 1.22.0
go: trying upgrade to example.net/[email protected]
go: trying upgrade to example.net/[email protected]
go: accepting indirect upgrade from [email protected] to 1.23.0
go: upgraded go 1.20 => 1.23.0
go: added toolchain go1.23.9
go: upgraded example.net/a v0.1.0 => v0.2.0
go: added example.net/b v0.1.0
go: added example.net/c v0.1.0
go: added example.net/d v0.2.0
-- go.mod --
module example

go 1.20

require example.net/a v0.1.0

replace (
	example.net/a v0.1.0 => ./a1
	example.net/a v0.2.0 => ./a2
	example.net/b v0.1.0 => ./b1
	example.net/c v0.1.0 => ./c1
	example.net/d v0.1.0 => ./d1
	example.net/d v0.2.0 => ./d2
)
-- go.mod.tidy --
module example

go 1.22.0

toolchain go1.22.9

require (
	example.net/a v0.1.0
	example.net/b v0.1.0
)

require (
	example.net/c v0.1.0 // indirect
	example.net/d v0.1.0 // indirect
)

replace (
	example.net/a v0.1.0 => ./a1
	example.net/a v0.2.0 => ./a2
	example.net/b v0.1.0 => ./b1
	example.net/c v0.1.0 => ./c1
	example.net/d v0.1.0 => ./d1
	example.net/d v0.2.0 => ./d2
)
-- go.mod.upgraded --
module example

go 1.23.0

toolchain go1.23.9

require (
	example.net/a v0.2.0
	example.net/b v0.1.0
)

require (
	example.net/c v0.1.0 // indirect
	example.net/d v0.2.0 // indirect
)

replace (
	example.net/a v0.1.0 => ./a1
	example.net/a v0.2.0 => ./a2
	example.net/b v0.1.0 => ./b1
	example.net/c v0.1.0 => ./c1
	example.net/d v0.1.0 => ./d1
	example.net/d v0.2.0 => ./d2
)
-- example.go --
package example

import (
	_ "example.net/a"
	_ "example.net/b"
)
-- a1/go.mod --
module example.net/a

go 1.20
-- a1/a.go --
package a
-- a2/go.mod --
module example.net/a

go 1.22.0

toolchain go1.23.0
-- a2/a.go --
package a
-- b1/go.mod --
module example.net/b

go 1.22.0

toolchain go1.23.0
-- b1/b.go --
package b

import _ "example.net/c"  // Note: module b is intentionally untidy, as if due to a bad git merge
-- c1/go.mod --
module example.net/c

go 1.22.0

require example.net/d v0.1.0
-- c1/c.go --
package c

import _ "example.net/d"
-- d1/go.mod --
module example.net/d

go 1.22.0
-- d1/d.go --
package d
-- d2/go.mod --
module example.net/d

go 1.23.0
-- d2/d.go --
package d