]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/types2/api.go
cmd/compile: update types2.Info.FileVersions API to match go/types
[gostls13.git] / src / cmd / compile / internal / types2 / api.go
index d807096db599900300dd784714155ba04f38bae0..675882c49f1b8d874e6355d8b9b6cd322e33be8c 100644 (file)
@@ -294,10 +294,12 @@ type Info struct {
        // appear in this list.
        InitOrder []*Initializer
 
-       // FileVersions maps a file's position base to the file's Go version.
-       // If the file doesn't specify a version and Config.GoVersion is not
-       // given, the reported version is the zero version (Major, Minor = 0, 0).
-       FileVersions map[*syntax.PosBase]Version
+       // FileVersions maps a file to its Go version string.
+       // If the file doesn't specify a version, the reported
+       // string is Config.GoVersion.
+       // Version strings begin with “go”, like “go1.21”, and
+       // are suitable for use with the [go/version] package.
+       FileVersions map[*syntax.PosBase]string
 }
 
 func (info *Info) recordTypes() bool {
@@ -431,12 +433,6 @@ func (init *Initializer) String() string {
        return buf.String()
 }
 
-// A Version represents a released Go version.
-type Version struct {
-       Major int
-       Minor int
-}
-
 // Check type-checks a package and returns the resulting package object and
 // the first error if any. Additionally, if info != nil, Check populates each
 // of the non-nil maps in the Info struct.