Skip to content

Instantly share code, notes, and snippets.

@kasuganosora
Created October 29, 2016 08:39
Show Gist options
  • Save kasuganosora/656b7758a60d6fe87e3d9f76f8842c75 to your computer and use it in GitHub Desktop.
Save kasuganosora/656b7758a60d6fe87e3d9f76f8842c75 to your computer and use it in GitHub Desktop.
Golang GRPC 生成protobuf类产生循环引用的解决方法
正确的姿势是
protoc --go_out=plugins=grpc:. *.proto
@mannixli
Copy link

我测试了这样还是会报溢出。
message Persion{
Person child=1,
Person father=2,
}
p1 = new
p2 = new
p1.child = &p2
p2.father = &p1
p1.Marshal() // runtime: goroutine stack exceeds 1000000000-byte limit
// fatal error: stack overflow

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