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

     1  # The command-line-arguments package does not belong to a module...
     2  cd a
     3  go list -f '{{.Module}}' ../b/b.go
     4  stdout '^<nil>$'
     5  
     6  # ... even if the arguments are sources from that module
     7  go list -f '{{.Module}}' a.go
     8  stdout '^<nil>$'
     9  
    10  [short] skip
    11  
    12  # check that the version of command-line-arguments doesn't include a module
    13  go build -o a.exe a.go
    14  go version -m a.exe
    15  stdout '^\tpath\tcommand-line-arguments$'
    16  stdout '^\tdep\ta\t\(devel\)\t$'
    17  ! stdout mod[^e]
    18  
    19  -- a/go.mod --
    20  module a
    21  go 1.17
    22  -- a/a.go --
    23  package main
    24  
    25  import "a/dep"
    26  
    27  func main() {
    28      dep.D()
    29  }
    30  -- a/dep/dep.go --
    31  package dep
    32  
    33  func D() {}
    34  -- b/b.go --
    35  package b

View as plain text