version

Imports

Imports #

"context"
"debug/buildinfo"
"errors"
"fmt"
"io/fs"
"os"
"path/filepath"
"runtime"
"strings"
"cmd/go/internal/base"
"cmd/go/internal/gover"

Constants & Variables

CmdVersion var #

var CmdVersion = *ast.UnaryExpr

versionM var #

var versionM = *ast.CallExpr

versionV var #

var versionV = *ast.CallExpr

Functions

init function #

func init()

isGoBinaryCandidate function #

isGoBinaryCandidate reports whether the file is a candidate to be a Go binary.

func isGoBinaryCandidate(file string, info fs.FileInfo) bool

runVersion function #

func runVersion(ctx context.Context, cmd *base.Command, args []string)

scanDir function #

scanDir scans a directory for binary to run scanFile on.

func scanDir(dir string)

scanFile function #

scanFile scans file to try to report the Go and module versions. If mustPrint is true, scanFile will report any error reading file. Otherwise (mustPrint is false, because scanFile is being called by scanDir) scanFile prints nothing for non-Go binaries. scanFile reports whether the file is a Go binary.

func scanFile(file string, info fs.FileInfo, mustPrint bool) bool

Generated with Arrow