Lindenii Project Forge
Warning: Due to various recent migrations, viewing non-HEAD refs may be broken.
/forged/internal/bare/varint.go (raw)
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2025 Drew Devault <https://drewdevault.com>
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()
}
}