This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
versions.go
92 lines (81 loc) · 2.21 KB
/
versions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Copyright 2016 Huan Du. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package goroutine
import (
"runtime"
"github.com/huandu/goroutine/version"
)
type _GoVersion int
const (
_GO_VERSION_INVALID _GoVersion = iota
_GO_VERSION1_5
_GO_VERSION1_5_1
_GO_VERSION1_5_2
_GO_VERSION1_5_3
_GO_VERSION1_5_4
_GO_VERSION1_6
_GO_VERSION1_6_1
_GO_VERSION1_6_2
_GO_VERSION1_6_3
_GO_VERSION1_7
_GO_VERSION1_7_1
_GO_VERSION1_7_2
_GO_VERSION1_7_3
_GO_VERSION1_7_4
_GO_VERSION1_7_5
_GO_VERSION1_8
_GO_VERSION1_8_1
)
var (
_goVersion version.Version
_goVersionCode = _GO_VERSION_INVALID
)
func init() {
var err error
v := runtime.Version()
_goVersion, err = version.Parse(v)
if err != nil {
return
} else if _goVersion.Equal("1", "5") {
_goVersionCode = _GO_VERSION1_5
} else if _goVersion.Equal("1", "5", "1") {
_goVersionCode = _GO_VERSION1_5_1
} else if _goVersion.Equal("1", "5", "2") {
_goVersionCode = _GO_VERSION1_5_2
} else if _goVersion.Equal("1", "5", "3") {
_goVersionCode = _GO_VERSION1_5_3
} else if _goVersion.Equal("1", "5", "4") {
_goVersionCode = _GO_VERSION1_5_4
} else if _goVersion.Equal("1", "6") {
_goVersionCode = _GO_VERSION1_6
} else if _goVersion.Equal("1", "6", "1") {
_goVersionCode = _GO_VERSION1_6_1
} else if _goVersion.Equal("1", "6", "2") {
_goVersionCode = _GO_VERSION1_6_2
} else if _goVersion.Equal("1", "6", "3") {
_goVersionCode = _GO_VERSION1_6_3
} else if _goVersion.Equal("1", "7") {
_goVersionCode = _GO_VERSION1_7
} else if _goVersion.Equal("1", "7", "1") {
_goVersionCode = _GO_VERSION1_7_1
} else if _goVersion.Equal("1", "7", "2") {
_goVersionCode = _GO_VERSION1_7_2
} else if _goVersion.Equal("1", "7", "3") {
_goVersionCode = _GO_VERSION1_7_3
} else if _goVersion.Equal("1", "7", "4") {
_goVersionCode = _GO_VERSION1_7_4
} else if _goVersion.Equal("1", "7", "5") {
_goVersionCode = _GO_VERSION1_7_5
} else if _goVersion.Equal("1", "8") {
_goVersionCode = _GO_VERSION1_8
} else if _goVersion.Equal("1", "8", "1") {
_goVersionCode = _GO_VERSION1_8_1
}
}
func goVersionCode() _GoVersion {
return _goVersionCode
}
func goVersion() version.Version {
return _goVersion
}