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

     1  env GO111MODULE=off
     2  
     3  ! go install p1
     4  stderr 'binary-only packages are no longer supported'
     5  
     6  mv p1_not_binary_only.go.txt p1/p1.go
     7  go install p1
     8  rm p1/p1.go
     9  ! exists p1/p1.go
    10  
    11  ! go install p2
    12  stderr 'no Go files'
    13  
    14  mv p1_missing.go.txt p1/missing.go
    15  ! go install p2
    16  stderr 'package p2\n\timports p1: binary-only packages are no longer supported'
    17  
    18  go list -deps -e -f '{{.ImportPath}}: {{.BinaryOnly}}' p2
    19  stdout 'p1: true'
    20  stdout 'p2: false'
    21  
    22  ! go install p3
    23  stderr 'package p3\n\timports p2\n\timports p1: binary-only packages are no longer supported'
    24  
    25  ! go install p4
    26  stderr 'package p4\n\timports p3\n\timports p2\n\timports p1: binary-only packages are no longer supported'
    27  
    28  go list -deps -e -f '{{.ImportPath}}: {{.BinaryOnly}}' p4
    29  stdout 'p1: true'
    30  stdout 'p2: false'
    31  stdout 'p3: false'
    32  stdout 'p4: false'
    33  
    34  -- p1/p1.go --
    35  //go:binary-only-package
    36  
    37  package p1
    38  -- p2/p2.go --
    39  //go:binary-only-packages-are-not-great
    40  
    41  package p2
    42  import "p1"
    43  func F() { p1.F(true) }
    44  -- p1_not_binary_only.go.txt --
    45  package p1
    46  import "fmt"
    47  func F(b bool) { fmt.Printf("hello from p1\n"); if b { F(false) } }
    48  -- p1_missing.go.txt --
    49  //go:binary-only-package
    50  
    51  package p1
    52  import _ "fmt"
    53  func G()
    54  -- p3/p3.go --
    55  package p3
    56  
    57  import "p2"
    58  
    59  func G() { p2.F() }
    60  
    61  -- p4/p4.go --
    62  package p4
    63  
    64  import "p3"
    65  
    66  func H() { p3.G() }
    67  

View as plain text