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

     1  # When adding a requirement, 'go get' prints a message for the requirement
     2  # and for changed explicit dependencies. 'go get' does not print messages
     3  # for changed indirect dependencies.
     4  go list -m all
     5  ! stdout golang.org/x/text
     6  go get rsc.io/quote@v1.5.2
     7  stderr '^go: added rsc.io/quote v1.5.2$'
     8  stderr '^go: upgraded rsc.io/sampler v1.0.0 => v1.3.0$'
     9  ! stderr '^go get.*golang.org/x/text'
    10  go list -m all
    11  stdout golang.org/x/text
    12  cmp go.mod go.mod.upgrade
    13  
    14  # When removing a requirement, 'go get' prints a message for the requiremnent
    15  # and for changed explicit dependencies. 'go get' does not print messages
    16  # for changed indirect dependencies.
    17  go get rsc.io/sampler@none
    18  stderr '^go: downgraded rsc.io/quote v1.5.2 => v1.3.0$'
    19  stderr '^go: removed rsc.io/sampler v1.3.0$'
    20  ! stderr '^go get.*golang.org/x/text'
    21  cmp go.mod go.mod.downgrade
    22  
    23  # When removing or downgrading a requirement, 'go get' also prints a message
    24  # for explicit dependencies removed as a consequence.
    25  cp go.mod.usequote go.mod
    26  go get rsc.io/quote@v1.5.1
    27  stderr '^go: downgraded rsc.io/quote v1.5.2 => v1.5.1$'
    28  stderr '^go: removed usequote v0.0.0$'
    29  
    30  -- go.mod --
    31  module m
    32  
    33  go 1.16
    34  
    35  require rsc.io/sampler v1.0.0
    36  -- go.sum --
    37  rsc.io/sampler v1.0.0 h1:SRJnjyQ07sAtq6G4RcfJEmz8JxqLyj3PoGXG2VhbDWo=
    38  rsc.io/sampler v1.0.0/go.mod h1:cqxpM3ZVz9VtirqxZPmrWzkQ+UkiNiGtkrN+B+i8kx8=
    39  -- go.mod.upgrade --
    40  module m
    41  
    42  go 1.16
    43  
    44  require (
    45  	rsc.io/quote v1.5.2 // indirect
    46  	rsc.io/sampler v1.3.0
    47  )
    48  -- go.mod.downgrade --
    49  module m
    50  
    51  go 1.16
    52  
    53  require (
    54  	golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect
    55  	rsc.io/quote v1.3.0 // indirect
    56  )
    57  -- go.mod.usequote --
    58  module m
    59  
    60  go 1.16
    61  
    62  require usequote v0.0.0
    63  
    64  replace usequote => ./usequote
    65  -- usequote/go.mod --
    66  module usequote
    67  
    68  go 1.16
    69  
    70  require rsc.io/quote v1.5.2
    71  

View as plain text