lab008

command
v0.0.0-...-f10d331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 7 Imported by: 0

README

测试any

在proto中使用any

注意

any的使用,还是要在.proto文件里面定义几个message的。比如,我定义了三个message,分别是A、B、C 那么我可以在C里面创建一个any字段,我可以在any里面放A或者B属性,C都可以解析。是这样一个功能。

运行结果

Imgur

参考资料

  1. https://medium.com/@pokstad/sending-any-any-thing-in-golang-with-protobuf-3-95f84838028d

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.
playground
p1
p2
p2/pb
Package anything is a generated protocol buffer package.
Package anything is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL