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

     1  # Regression test for https://go.dev/issue/51448.
     2  # 'go work init . .. foo/bar' should produce a go.work file
     3  # with the same paths as 'go work init; go work use -r ..',
     4  # and it should have 'use .' rather than 'use ./.' inside.
     5  
     6  cd dir
     7  
     8  go work init . .. foo/bar
     9  mv go.work go.work.init
    10  
    11  go work init
    12  go work use -r ..
    13  cmp go.work go.work.init
    14  
    15  cmpenv go.work $WORK/go.work.want
    16  
    17  -- go.mod --
    18  module example
    19  go 1.18
    20  -- dir/go.mod --
    21  module example
    22  go 1.18
    23  -- dir/foo/bar/go.mod --
    24  module example
    25  go 1.18
    26  -- $WORK/go.work.want --
    27  go $goversion
    28  
    29  use (
    30  	.
    31  	..
    32  	./foo/bar
    33  )
    34  

View as plain text