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

A panic occurs when there is a circular reference to the structure #7

Open
voctior opened this issue Jun 14, 2022 · 0 comments
Open

Comments

@voctior
Copy link

voctior commented Jun 14, 2022

A panic occurs when there is a circular reference to the structure

code

func Test_xxx(t *testing.T) {
	type Node struct {
		ID   int
		Next *Node
	}
	var node Node
	err := allocate.Zero(&node)
	if err != nil {
		panic(err)
	}
	t.Logf("%+v", node.Next)
}

run test

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc0200f0388 stack=[0xc0200f0000, 0xc0400f0000]
fatal error: stack overflow

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

No branches or pull requests

1 participant