...

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

Documentation: cmd/go/testdata/script

     1go list tool
     2stdout example.com/foo/cmd
     3stdout example.com/dependency/cmd/bar
     4go list all
     5stdout example.com/foo/cmd
     6stdout example.com/foo/lib
     7stdout example.com/dependency/cmd/bar
     8
     9cd workspace
    10go list tool
    11stdout example.com/foo/cmd
    12stdout example.com/dependency/cmd/bar
    13stdout example.com/dependency/cmd/baz
    14go list all
    15stdout example.com/foo/cmd
    16stdout example.com/foo/lib
    17stdout example.com/other
    18stdout example.com/dependency/cmd/bar
    19stdout example.com/dependency/cmd/baz
    20
    21cd ../invalid_path
    22! go list all
    23stderr 'malformed tool path'
    24
    25-- go.mod --
    26module example.com/foo
    27
    28go 1.24
    29
    30tool example.com/foo/cmd/eg
    31tool example.com/dependency/cmd/bar
    32
    33replace example.com/dependency => ./dependency
    34
    35require example.com/dependency v1.0.0
    36
    37-- lib/main.go --
    38package lib
    39
    40-- cmd/eg/main.go --
    41package main
    42
    43func main(){}
    44
    45-- dependency/go.mod --
    46module example.com/dependency
    47
    48go 1.24
    49-- dependency/cmd/bar/main.go --
    50package main
    51
    52func main(){}
    53-- dependency/cmd/baz/main.go --
    54package main
    55
    56func main() {}
    57-- other/go.mod --
    58module example.com/other
    59
    60go 1.24
    61
    62tool example.com/dependency/cmd/baz
    63
    64replace example.com/dependency => ../dependency
    65
    66require example.com/dependency v1.0.0
    67-- other/lib.go --
    68package other
    69-- workspace/go.work --
    70go 1.24
    71
    72use (
    73    ../
    74    ../other
    75)
    76
    77-- invalid_path/go.mod --
    78module example.com/invalid_path
    79
    80go 1.24
    81
    82tool ./invalid_path

View as plain text