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_tidy_lazy_self.txt
# Regression test for https://golang.org/issue/46078:
# 'go mod tidy' should not panic if the main module initially
# requires an older version of itself.

# A module may require an older version of itself without error. This is
# inconsistent (the required version is never selected), but we still get
# a reproducible build list.
go list -m all
stdout '^golang.org/issue/46078$'

# 'go mod tidy' should fix this (and not crash).
go mod tidy


# We prune out redundant roots very early on in module loading, and at that
# point the indirect requirement on example.net/x v0.1.0 appears to be
# irrelevant. It should be pruned out; when the import of "example.net/x" is
# later resolved, it should resolve at the latest version (v0.2.0), not the
# version implied by the (former) misleading requirement on the older version of
# the main module.

cmp go.mod go.mod.tidy


-- go.mod --
module golang.org/issue/46078

go 1.17

replace (
	example.net/x v0.1.0 => ./x
	example.net/x v0.2.0 => ./x
	golang.org/issue/46078 v0.1.0 => ./old
)

require golang.org/issue/46078 v0.1.0
-- go.mod.tidy --
module golang.org/issue/46078

go 1.17

replace (
	example.net/x v0.1.0 => ./x
	example.net/x v0.2.0 => ./x
	golang.org/issue/46078 v0.1.0 => ./old
)

require example.net/x v0.2.0
-- issue46078/issue.go --
package issue46078

import _ "example.net/x"

-- old/go.mod --
module golang.org/issue/46078

go 1.17

require example.net/x v0.1.0

-- x/go.mod --
module example.net/x

go 1.17
-- x/x.go --
package x