
for convenience. Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: https://svn.yakumo.dev/yakumo.izuru/suika/trunk@822 f0ae65fe-ee39-954e-97ec-027ff2717ef4
28 lines
424 B
Go
28 lines
424 B
Go
package bare
|
|
|
|
import (
|
|
"reflect"
|
|
)
|
|
|
|
// Int is a variable-length encoded signed integer.
|
|
type Int int64
|
|
|
|
// Uint is a variable-length encoded unsigned integer.
|
|
type Uint uint64
|
|
|
|
var (
|
|
intType = reflect.TypeOf(Int(0))
|
|
uintType = reflect.TypeOf(Uint(0))
|
|
)
|
|
|
|
func getIntKind(t reflect.Type) reflect.Kind {
|
|
switch t {
|
|
case intType:
|
|
return reflect.Int
|
|
case uintType:
|
|
return reflect.Uint
|
|
default:
|
|
return t.Kind()
|
|
}
|
|
}
|