Skip to content
New issue

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

cwgo doc 使用proto2 生成代码报错,能否支持下 #223

Open
pigfu opened this issue Oct 29, 2024 · 0 comments
Open

cwgo doc 使用proto2 生成代码报错,能否支持下 #223

pigfu opened this issue Oct 29, 2024 · 0 comments

Comments

@pigfu
Copy link

pigfu commented Oct 29, 2024

Describe the bug

命令:cwgo doc -idl order.proto --module app --dao_dir biz/dal/mongo --model_dir biz/model -I .

结果:[ERROR]D:/gopath/pkg/mod/github.com/cloudwego/[email protected]/cwgo.go:47: can not find Id field in struct Order

实际Order结构体如下:

type Order struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Id         *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` // go.tag=|bson:"id,omitempty"|
	UserId     *string `protobuf:"bytes,2,opt,name=user_id,json=userId" json:"user_id,omitempty"`
	Type       *string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"`
	Name       *string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"`
	Price      *string `protobuf:"bytes,5,opt,name=price" json:"price,omitempty"`
	CreateTime *string `protobuf:"bytes,6,opt,name=create_time,json=createTime" json:"create_time,omitempty"`
	UpdateTime *string `protobuf:"bytes,7,opt,name=update_time,json=updateTime" json:"update_time,omitempty"`
	Status     *string `protobuf:"bytes,8,opt,name=status" json:"status,omitempty"`
}

猜测是指针的原因

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant