github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/analysis/code/version.go (about) 1 //go:build go1.21 2 3 package code 4 5 import ( 6 "go/ast" 7 "go/types" 8 ) 9 10 func fileGoVersion(f *ast.File) string { 11 return f.GoVersion 12 } 13 14 func packageGoVersion(pkg *types.Package) string { 15 return pkg.GoVersion() 16 }