github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/version/version.go (about)

     1  // Copyright 2011 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Package version implements the “go version” command.
     6  package version
     7  
     8  import (
     9  	"github.com/shogo82148/std/cmd/go/internal/base"
    10  )
    11  
    12  var CmdVersion = &base.Command{
    13  	UsageLine: "go version [-m] [-v] [file ...]",
    14  	Short:     "print Go version",
    15  	Long: `Version prints the build information for Go binary files.
    16  
    17  Go version reports the Go version used to build each of the named files.
    18  
    19  If no files are named on the command line, go version prints its own
    20  version information.
    21  
    22  If a directory is named, go version walks that directory, recursively,
    23  looking for recognized Go binaries and reporting their versions.
    24  By default, go version does not report unrecognized files found
    25  during a directory scan. The -v flag causes it to report unrecognized files.
    26  
    27  The -m flag causes go version to print each file's embedded
    28  module version information, when available. In the output, the module
    29  information consists of multiple lines following the version line, each
    30  indented by a leading tab character.
    31  
    32  See also: go doc runtime/debug.BuildInfo.
    33  `,
    34  }