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

     1  # Test that pgo properly splits off the Imports field so that list doesn't alias
     2  # the non-pgo variant's slice when it modifies the pgo variant's Imports field to
     3  # add the [.ForMain] suffix.
     4  
     5  go list -f 'ImportPath: "{{.ImportPath}}", Imports: "{{.Imports}}", ImportMap: "{{.ImportMap}}"' m/a m/b
     6  cmp stdout want
     7  
     8  -- want --
     9  ImportPath: "m/a", Imports: "[m/b [m/a]]", ImportMap: "map[m/b:m/b [m/a]]"
    10  ImportPath: "m/b", Imports: "[m/c]", ImportMap: "map[]"
    11  -- go.mod --
    12  module m
    13  
    14  go 1.23
    15  
    16  -- a/a.go --
    17  package main
    18  
    19  import _ "m/b"
    20  -- a/default.pgo --
    21  -- b/b.go --
    22  package a
    23  
    24  import _ "m/c"
    25  
    26  -- c/c.go --
    27  package c
    28  
    29  

View as plain text