...

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

Documentation: cmd/go/testdata/script

     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
     5go list -f 'ImportPath: "{{.ImportPath}}", Imports: "{{.Imports}}", ImportMap: "{{.ImportMap}}"' m/a m/b
     6cmp stdout want
     7
     8-- want --
     9ImportPath: "m/a", Imports: "[m/b [m/a]]", ImportMap: "map[m/b:m/b [m/a]]"
    10ImportPath: "m/b", Imports: "[m/c]", ImportMap: "map[]"
    11-- go.mod --
    12module m
    13
    14go 1.23
    15
    16-- a/a.go --
    17package main
    18
    19import _ "m/b"
    20-- a/default.pgo --
    21-- b/b.go --
    22package a
    23
    24import _ "m/c"
    25
    26-- c/c.go --
    27package c
    28

View as plain text