...

Text file src/cmd/go/testdata/script/mod_get_nopkgs.txt

Documentation: cmd/go/testdata/script

     1cd subdir
     2
     3# 'go get' on empty patterns that are necessarily local to the module
     4# should warn that the patterns are empty, exactly once.
     5
     6go get ./...
     7stderr -count=1 'matched no packages'
     8
     9go get ./...
    10stderr -count=1 'matched no packages'
    11
    12# 'go get' on patterns that could conceivably match nested modules
    13# should report a module resolution error.
    14
    15go get example.net/emptysubdir/... # control case
    16
    17! go get example.net/emptysubdir/subdir/...
    18! stderr 'matched no packages'
    19stderr '^go: example\.net/emptysubdir/subdir/\.\.\.: module example\.net/emptysubdir/subdir: reading http://.*: 404 Not Found\n\tserver response: 404 page not found\n\z'
    20
    21# It doesn't make sense to 'go get' a path in the standard library,
    22# since the standard library necessarily can't have unresolved imports.
    23#
    24# TODO(#30241): Maybe that won't always be the case?
    25#
    26# For that case, we emit a "malformed module path" error message,
    27# which isn't ideal either.
    28
    29! go get builtin/...  # in GOROOT/src, but contains no packages
    30stderr '^go: builtin/...: malformed module path "builtin": missing dot in first path element$'
    31
    32-- go.mod --
    33module example.net/emptysubdir
    34
    35go 1.16
    36-- emptysubdir.go --
    37// Package emptysubdir has a subdirectory containing no packages.
    38package emptysubdir
    39-- subdir/README.txt --
    40This module intentionally does not contain any p

View as plain text