Ai
1 Star 0 Fork 1

cx/protoc-gen-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
enum.go 566 Bytes
一键复制 编辑 原始数据 按行查看 历史
cw290746987 提交于 2021-06-01 11:10 +08:00 . 1
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package impl
import (
"reflect"
pref "gitee.com/290746987/protoc-gen-go/reflect/protoreflect"
)
type EnumInfo struct {
GoReflectType reflect.Type // int32 kind
Desc pref.EnumDescriptor
}
func (t *EnumInfo) New(n pref.EnumNumber) pref.Enum {
return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(pref.Enum)
}
func (t *EnumInfo) Descriptor() pref.EnumDescriptor { return t.Desc }
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/290746987/protoc-gen-go.git
git@gitee.com:290746987/protoc-gen-go.git
290746987
protoc-gen-go
protoc-gen-go
v1.0.0

搜索帮助