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

     1  go work use -r foo
     2  cmp go.work go.want_work_r
     3  
     4  ! go work use other
     5  stderr '^go: error reading other'${/}'go.mod: missing module declaration'
     6  
     7  go mod edit -C other -module=other
     8  go work use other
     9  cmp go.work go.want_work_other
    10  -- go.work --
    11  go 1.18
    12  
    13  use (
    14  	foo
    15  	foo/bar // doesn't exist
    16  )
    17  -- go.want_work_r --
    18  go 1.18
    19  
    20  use (
    21  	./foo
    22  	./foo/bar/baz
    23  )
    24  -- go.want_work_other --
    25  go 1.18
    26  
    27  use (
    28  	./foo
    29  	./foo/bar/baz
    30  	./other
    31  )
    32  -- foo/go.mod --
    33  module foo
    34  -- foo/bar/baz/go.mod --
    35  module baz
    36  -- other/go.mod --
    37  

View as plain text