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_ambiguous_import.txt
env GO111MODULE=on

cd $WORK

# An import provided by two different modules should be flagged as an error.
! go build ./importx
stderr '^importx[/\\]importx.go:2:8: ambiguous import: found package example.com/a/x in multiple modules:\n\texample.com/a v0.1.0 \('$WORK'[/\\]a[/\\]x\)\n\texample.com/a/x v0.1.0 \('$WORK'[/\\]ax\)$'

# However, it should not be an error if that import is unused.
go build ./importy

# An import provided by both the main module and the vendor directory
# should be flagged as an error only when -mod=vendor is set.
mkdir vendor/example.com/m/importy
cp $WORK/importy/importy.go vendor/example.com/m/importy/importy.go
go build example.com/m/importy
! go build -mod=vendor example.com/m/importy
stderr '^ambiguous import: found package example.com/m/importy in multiple directories:\n\t'$WORK'[/\\]importy\n\t'$WORK'[/\\]vendor[/\\]example.com[/\\]m[/\\]importy$'

-- $WORK/go.mod --
module example.com/m
go 1.13
require (
	example.com/a v0.1.0
	example.com/a/x v0.1.0
)
replace (
	example.com/a v0.1.0 => ./a
	example.com/a/x v0.1.0 => ./ax
)
-- $WORK/importx/importx.go --
package importx
import _ "example.com/a/x"
-- $WORK/importy/importy.go --
package importy
import _ "example.com/a/y"
-- $WORK/a/go.mod --
module example.com/a
go 1.14
-- $WORK/a/x/x.go --
package x
-- $WORK/a/y/y.go --
package y
-- $WORK/ax/go.mod --
module example.com/a/x
go 1.14
-- $WORK/ax/x.go --
package x