mirror of
https://github.com/hanzoai/beego.git
synced 2026-11-17 13:19:25 +00:00
Patches against upstream beego/[email protected]: server/web/admin_controller.go — promhttp.Handler → luxfi/metric HTTP handler server/web/filter/prometheus/ — luxfi/metric backend, drops MustRegister client/httplib/filter/prometheus/ — luxfi/metric backend client/orm/filter/prometheus/ — luxfi/metric backend core/config/etcd/config.go — drop grpc-ecosystem/go-grpc-prometheus interceptors (etcd dialing has no observability through this path) Default closure: 0 grpc, 0 protobuf, 0 prometheus/client_golang. Consumers in hanzoai/iam see the fork through workspace mode.
37 lines
697 B
Go
37 lines
697 B
Go
package utils
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestCompareGoVersion(t *testing.T) {
|
|
targetVersion := "go1.8"
|
|
if compareGoVersion("go1.12.4", targetVersion) != 1 {
|
|
t.Error("should be 1")
|
|
}
|
|
|
|
if compareGoVersion("go1.8.7", targetVersion) != 1 {
|
|
t.Error("should be 1")
|
|
}
|
|
|
|
if compareGoVersion("go1.8", targetVersion) != 0 {
|
|
t.Error("should be 0")
|
|
}
|
|
|
|
if compareGoVersion("go1.7.6", targetVersion) != -1 {
|
|
t.Error("should be -1")
|
|
}
|
|
|
|
if compareGoVersion("go1.12.1rc1", targetVersion) != 1 {
|
|
t.Error("should be 1")
|
|
}
|
|
|
|
if compareGoVersion("go1.8rc1", targetVersion) != 0 {
|
|
t.Error("should be 0")
|
|
}
|
|
|
|
if compareGoVersion("go1.7rc1", targetVersion) != -1 {
|
|
t.Error("should be -1")
|
|
}
|
|
}
|