mirror of
https://github.com/zrepl/zrepl.git
synced 2025-02-18 03:11:55 +01:00
Go upgrade: - Go 1.23 is current => use that for release builds - Go 1.22 is less than one year old, it's desirable to support it. - The [`Go Toolchains`](https://go.dev/doc/toolchain) stuff is available in both of these (would also be in Go 1.21). That is quite nice stuff, but required some changes to how we versions we use in CircleCI and the `release-docker` Makefile target. Protobuf upgrade: - Go to protobuf GH release website - Download latest locally - run `sha256sum` - replace existing pinned hashes - `make generate` Deps upgrade: - `go get -t -u all` - repository moves aren't handled well automatically, fix manually - repeat until no changes
52 lines
1.4 KiB
Go
52 lines
1.4 KiB
Go
// Code generated by "enumer -type NoFitBehavior"; DO NOT EDIT.
|
|
|
|
package base2bufpool
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
const _NoFitBehaviorName = "PanicAllocateSmallerAllocateLargerAllocate"
|
|
|
|
var _NoFitBehaviorIndex = [...]uint8{0, 5, 20, 34, 42}
|
|
|
|
func (i NoFitBehavior) String() string {
|
|
if i >= NoFitBehavior(len(_NoFitBehaviorIndex)-1) {
|
|
return fmt.Sprintf("NoFitBehavior(%d)", i)
|
|
}
|
|
return _NoFitBehaviorName[_NoFitBehaviorIndex[i]:_NoFitBehaviorIndex[i+1]]
|
|
}
|
|
|
|
var _NoFitBehaviorValues = []NoFitBehavior{0, 1, 2, 3}
|
|
|
|
var _NoFitBehaviorNameToValueMap = map[string]NoFitBehavior{
|
|
_NoFitBehaviorName[0:5]: 0,
|
|
_NoFitBehaviorName[5:20]: 1,
|
|
_NoFitBehaviorName[20:34]: 2,
|
|
_NoFitBehaviorName[34:42]: 3,
|
|
}
|
|
|
|
// NoFitBehaviorString retrieves an enum value from the enum constants string name.
|
|
// Throws an error if the param is not part of the enum.
|
|
func NoFitBehaviorString(s string) (NoFitBehavior, error) {
|
|
if val, ok := _NoFitBehaviorNameToValueMap[s]; ok {
|
|
return val, nil
|
|
}
|
|
return 0, fmt.Errorf("%s does not belong to NoFitBehavior values", s)
|
|
}
|
|
|
|
// NoFitBehaviorValues returns all values of the enum
|
|
func NoFitBehaviorValues() []NoFitBehavior {
|
|
return _NoFitBehaviorValues
|
|
}
|
|
|
|
// IsANoFitBehavior returns "true" if the value is listed in the enum definition. "false" otherwise
|
|
func (i NoFitBehavior) IsANoFitBehavior() bool {
|
|
for _, v := range _NoFitBehaviorValues {
|
|
if i == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|