Black Lives Matter. Support the Equal Justice Initiative.

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

Documentation: cmd/go/testdata/script

     1  # Test internal package errors are handled
     2  cd testinternal3
     3  go list .
     4  stdout 'testinternal3'
     5  
     6  # Test internal cache
     7  cd ../testinternal4
     8  ! go build testinternal4/p
     9  stderr 'internal'
    10  
    11  # Test internal packages outside GOROOT are respected
    12  cd ../testinternal2
    13  ! go build -v .
    14  stderr 'p\.go:3:8: use of internal package .*internal/w not allowed'
    15  
    16  [gccgo] skip # gccgo does not have GOROOT
    17  cd ../testinternal
    18  ! go build -v .
    19  stderr 'p\.go:3:8: use of internal package net/http/internal not allowed'
    20  
    21  -- testinternal/go.mod --
    22  module testinternal
    23  
    24  go 1.16
    25  -- testinternal/p.go --
    26  package p
    27  
    28  import _ "net/http/internal"
    29  -- testinternal2/go.mod --
    30  module testinternal2
    31  
    32  go 1.16
    33  -- testinternal2/p.go --
    34  package p
    35  
    36  import _ "./x/y/z/internal/w"
    37  -- testinternal2/x/y/z/internal/w/w.go --
    38  package w
    39  -- testinternal3/go.mod --
    40  module testinternal3
    41  
    42  go 1.16
    43  -- testinternal3/t.go --
    44  package t
    45  
    46  import _ "internal/does-not-exist"
    47  -- testinternal4/go.mod --
    48  module testinternal4
    49  
    50  go 1.16
    51  -- testinternal4/p/p.go --
    52  package p
    53  
    54  import (
    55  	_ "testinternal4/q/internal/x"
    56  	_ "testinternal4/q/j"
    57  )
    58  -- testinternal4/q/internal/x/x.go --
    59  package x
    60  -- testinternal4/q/j/j.go --
    61  package j
    62  
    63  import _ "testinternal4/q/internal/x"
    64  

View as plain text