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

     1  # When there is a short single-line message, 'go get' should print it all.
     2  go get short
     3  stderr '^go: module short is deprecated: short$'
     4  go list -m -u -f '{{.Deprecated}}' short
     5  stdout '^short$'
     6  
     7  # When there is a multi-line message, 'go get' should print the first line.
     8  go get multiline
     9  stderr '^go: module multiline is deprecated: first line$'
    10  ! stderr 'second line'
    11  go list -m -u -f '{{.Deprecated}}' multiline
    12  stdout '^first line\nsecond line.$'
    13  
    14  # When there is a long message, 'go get' should print a placeholder.
    15  go get long
    16  stderr '^go: module long is deprecated: \(message omitted: too long\)$'
    17  go list -m -u -f '{{.Deprecated}}' long
    18  stdout '^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$'
    19  
    20  # When a message contains unprintable characters, 'go get' should say that
    21  # without printing the message.
    22  go get unprintable
    23  stderr '^go: module unprintable is deprecated: \(message omitted: contains non-printable characters\)$'
    24  go list -m -u -f '{{.Deprecated}}' unprintable
    25  stdout '^message contains ASCII BEL\x07$'
    26  
    27  -- go.mod --
    28  module use
    29  
    30  go 1.16
    31  
    32  require (
    33  	short v0.0.0
    34  	multiline v0.0.0
    35  	long v0.0.0
    36  	unprintable v0.0.0
    37  )
    38  
    39  replace (
    40  	short v0.0.0 => ./short
    41  	multiline v0.0.0 => ./multiline
    42  	long v0.0.0 => ./long
    43  	unprintable v0.0.0 => ./unprintable
    44  )
    45  -- short/go.mod --
    46  // Deprecated: short
    47  module short
    48  
    49  go 1.16
    50  -- short/short.go --
    51  package short
    52  -- multiline/go.mod --
    53  // Deprecated: first line
    54  // second line.
    55  module multiline
    56  
    57  go 1.16
    58  -- multiline/multiline.go --
    59  package multiline
    60  -- long/go.mod --
    61  // Deprecated: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    62  module long
    63  
    64  go 1.16
    65  -- long/long.go --
    66  package long
    67  -- unprintable/go.mod --
    68  // Deprecated: message contains ASCII BEL
    69  module unprintable
    70  
    71  go 1.16
    72  -- unprintable/unprintable.go --
    73  package unprintable
    74  

View as plain text