我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

在golang中使用反射检查Protobuf类型

I have compiled and imported a protocol buffer package with several types in go.

In my go program, I'd like to inspect one of those type given the name of the type in a variable. How can that be done?

For example, if the .proto is defined as:

message foo {
    String bar = 1;
}

How can I get the type foo from my go program, assuming I have a variable that equals foo

近期文章

  • 设置bccsp类型的MSP时,BYFN.sh失败,并出现错误
  • Go API中的连接被强制终止
  • tensorflow retrain.py等效golang
  • 如何限制成千上万的TCP连接的缓慢断开?
  • termui的termui.Handle(“ / timer / 1s”,func(e termui.Event))在ubuntu 18.04上不起作用
  • 绘制图表动态数据
  • 使用MongoDB从Golang中的子对象数组获取值
  • 引用“不是类型”-将类型存储在结构中
  • 如果起点和终点的长度超过25个,我们如何使用Google Distance Matrix API进行实时跟踪?
  • 无法为Go应用程序创建Docker映像
  • DynamoDB PutItem上的条件表达式
  • 去lang测试结构-使用银杏花测试时间太长
  • AddressSanitizer报告本身是否泄漏?
  • 读取任意数量的输入stdin
  • goland使用secp256.go文件调试go-ethereum错误
  • GPG命令在Shell中有效,但在Go exec.Command()中无效
  • 从HandlerFunc返回错误-需要新类型
  • Golang Firebase管理员SDK
  • 根据golang中的条件执行自解组方法或默认解组方法
  • 当我从tcp缓冲区读取时,应该为mtu值选择哪个数字

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华