We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在设置pb.option("no_default_values")的情况下,无论是没赋值还是赋的默认值,decode出来都是nil,请问怎么区分呢? 另,试了 local parser = protoc.new(); parser.proto3_optional = true 之后在proto3中加入 optional 依然报错
The text was updated successfully, but these errors were encountered:
你试试最新的master的版本,我这边是OK的:
local pb = require "pb" local slice = require "pb.slice" local buffer = require "pb.buffer" local protoc = require "protoc" local serpent = require "serpent" local parser = protoc.new() parser.proto3_optional = true parser:load [[ syntax = "proto3"; message Test { optional uint32 foo = 1; } ]] print(serpent.block(pb.decode("Test", pb.encode("Test", {})))) print(serpent.block(pb.decode("Test", pb.encode("Test", {foo = 0}))))
输出:
{} --[[table: 00000195450FBEF0]] { foo = 0, optional_foo = "foo" } --[[table: 00000195450FC830]]
Sorry, something went wrong.
No branches or pull requests
在设置pb.option("no_default_values")的情况下,无论是没赋值还是赋的默认值,decode出来都是nil,请问怎么区分呢?
另,试了
local parser = protoc.new();
parser.proto3_optional = true
之后在proto3中加入 optional 依然报错
The text was updated successfully, but these errors were encountered: