.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / lintcmd / version / version.go
1 package version
2
3 import (
4         "fmt"
5         "os"
6         "path/filepath"
7         "runtime"
8 )
9
10 const Version = "2020.2.1"
11 const MachineVersion = "v0.1.1"
12
13 // version returns a version descriptor and reports whether the
14 // version is a known release.
15 func version() (human, machine string, known bool) {
16         if Version != "devel" {
17                 return Version, MachineVersion, true
18         }
19         v, ok := buildInfoVersion()
20         if ok {
21                 return v, "", false
22         }
23         return "devel", "", false
24 }
25
26 func Print() {
27         human, machine, release := version()
28
29         if release {
30                 fmt.Printf("%s %s (%s)\n", filepath.Base(os.Args[0]), human, machine)
31         } else if human == "devel" {
32                 fmt.Printf("%s (no version)\n", filepath.Base(os.Args[0]))
33         } else {
34                 fmt.Printf("%s (devel, %s)\n", filepath.Base(os.Args[0]), human)
35         }
36 }
37
38 func Verbose() {
39         Print()
40         fmt.Println()
41         fmt.Println("Compiled with Go version:", runtime.Version())
42         printBuildInfo()
43 }