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

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

View as plain text