...

Text file src/cuelang.org/go/internal/mod/modpkgload/testdata/localpackageambiguous.txtar

Documentation: cuelang.org/go/internal/mod/modpkgload/testdata

     1# test0 shows that we can have a local import
     2# and it's OK even when there's a matching module
     3# in the registry.
     4
     5# test1 shows that if there is a matching module already
     6# in the requirements that we get an "ambiguous import"
     7# error.
     8
     9-- test0/initial-requirements --
    10main.test@v0
    11-- test0/root-packages --
    12main.test@v0:main
    13-- test0/default-major-versions --
    14-- test0/want --
    15main.test@v0:main
    16	flags: inAll,isRoot,fromRoot,importsLoaded
    17	mod: main.test@v0
    18	location: .
    19	imports:
    20		example.com/blah
    21example.com/blah
    22	flags: inAll,isRoot,fromRoot,importsLoaded
    23	mod: local
    24	location: cue.mod/gen/example.com/blah
    25-- test1/initial-requirements --
    26main.test@v0
    27example.com@v0.0.1
    28-- test1/root-packages --
    29main.test@v0:main
    30-- test1/default-major-versions --
    31-- test1/want --
    32main.test@v0:main
    33	flags: inAll,isRoot,fromRoot,importsLoaded
    34	mod: main.test@v0
    35	location: .
    36	imports:
    37		example.com/blah
    38example.com/blah
    39	flags: inAll,isRoot,fromRoot
    40	error: ambiguous import: found package example.com/blah in multiple modules:
    41	example.com@v0 v0.0.1 (_registry/example.com_v0.0.1/blah)
    42	local (cue.mod/gen/example.com/blah)
    43	missing: false
    44-- main.cue --
    45package main
    46import "example.com/blah"
    47-- cue.mod/gen/example.com/blah/x.cue --
    48package blah
    49-- main.cue --
    50package main
    51import "example.com/blah"
    52
    53-- _registry/example.com_v0.0.1/cue.mod/module.cue --
    54module: "example.com@v0"
    55-- _registry/example.com_v0.0.1/blah/blah.cue --
    56package blah

View as plain text