libgo: update to Go 1.11
[official-gcc.git] / libgo / go / cmd / go / internal / version / version.go
blob9344a28dc36af57e2ca5953967a986fe2aad36ea
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.
5 // Package version implements the ``go version'' command.
6 package version
8 import (
9 "fmt"
10 "runtime"
12 "cmd/go/internal/base"
15 var CmdVersion = &base.Command{
16 Run: runVersion,
17 UsageLine: "go version",
18 Short: "print Go version",
19 Long: `Version prints the Go version, as reported by runtime.Version.`,
22 func runVersion(cmd *base.Command, args []string) {
23 if len(args) != 0 {
24 cmd.Usage()
27 fmt.Printf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)