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

     1  ! go list -export ./...
     2  stderr '^# example.com/p2\np2'${/}'main\.go:7:.*'
     3  ! stderr '^go build '
     4  
     5  go list -f '{{with .Error}}{{.}}{{end}}' -e -export ./...
     6  ! stderr '.'
     7  stdout '^# example.com/p2\np2'${/}'main\.go:7:.*'
     8  
     9  go list -export -e -f '{{.ImportPath}} -- {{.Incomplete}} -- {{.Error}}' ./...
    10  stdout 'example.com/p1 -- false -- <nil>'
    11  stdout 'example.com/p2 -- true -- # example.com/p2'
    12  
    13  go list -e -export -json=Error ./...
    14  stdout '"Err": "# example.com/p2'
    15  
    16  -- go.mod --
    17  module example.com
    18  -- p1/p1.go --
    19  package p1
    20  
    21  const Name = "p1"
    22  -- p2/main.go --
    23  package main
    24  
    25  import "fmt"
    26  import "example.com/p1"
    27  
    28  func main() {
    29  	fmt.Println(p1.Name == 5)
    30  }
    31  

View as plain text