1 Star 2 Fork 2

小桀/fate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
filter_option_enum.go 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
godcong 提交于 2023-03-14 18:50 . feat(fate): change for v4
// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:
package fate
import (
"errors"
"fmt"
)
const (
// CharacterFilterTypeDefault is a CharacterFilterType of type Default.
CharacterFilterTypeDefault CharacterFilterType = iota
// CharacterFilterTypeChs is a CharacterFilterType of type Chs.
CharacterFilterTypeChs
// CharacterFilterTypeCht is a CharacterFilterType of type Cht.
CharacterFilterTypeCht
// CharacterFilterTypeKangxi is a CharacterFilterType of type Kangxi.
CharacterFilterTypeKangxi
)
var ErrInvalidCharacterFilterType = errors.New("not a valid CharacterFilterType")
const _CharacterFilterTypeName = "defaultchschtkangxi"
var _CharacterFilterTypeMap = map[CharacterFilterType]string{
CharacterFilterTypeDefault: _CharacterFilterTypeName[0:7],
CharacterFilterTypeChs: _CharacterFilterTypeName[7:10],
CharacterFilterTypeCht: _CharacterFilterTypeName[10:13],
CharacterFilterTypeKangxi: _CharacterFilterTypeName[13:19],
}
// String implements the Stringer interface.
func (x CharacterFilterType) String() string {
if str, ok := _CharacterFilterTypeMap[x]; ok {
return str
}
return fmt.Sprintf("CharacterFilterType(%d)", x)
}
var _CharacterFilterTypeValue = map[string]CharacterFilterType{
_CharacterFilterTypeName[0:7]: CharacterFilterTypeDefault,
_CharacterFilterTypeName[7:10]: CharacterFilterTypeChs,
_CharacterFilterTypeName[10:13]: CharacterFilterTypeCht,
_CharacterFilterTypeName[13:19]: CharacterFilterTypeKangxi,
}
// ParseCharacterFilterType attempts to convert a string to a CharacterFilterType.
func ParseCharacterFilterType(name string) (CharacterFilterType, error) {
if x, ok := _CharacterFilterTypeValue[name]; ok {
return x, nil
}
return CharacterFilterType(0), fmt.Errorf("%s is %w", name, ErrInvalidCharacterFilterType)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/tangri/fate.git
git@gitee.com:tangri/fate.git
tangri
fate
fate
main

搜索帮助