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

gabs.Container.Path() returns null, even the value exists #117

Closed
x24870 opened this issue Mar 24, 2022 · 2 comments
Closed

gabs.Container.Path() returns null, even the value exists #117

x24870 opened this issue Mar 24, 2022 · 2 comments

Comments

@x24870
Copy link

x24870 commented Mar 24, 2022

I encountered a wired issue.
First, I start some goroutine then return the result by sending it to a channel.
Next use gabs.Container.SetP() to set these values to another gabs.Container.
When I try to get the value by gabs.Container.Path(), it returns null.
If you print the gabs.Container you can see the value exists, but can't access deeper level.

Not sure it's caused by transfer pointer through channel or gabs.Container.Path().
Here is the code to reproduce it.
https://go.dev/play/p/MWIk0UT7p45

@mihaitodor
Copy link
Contributor

Hey @x24870, thanks for reporting this issue! I think it's a duplicate of #98. Please see this comment from Ash. Basically, you'll need to do allRet.SetP(ret.Data(), strconv.Itoa(ret.Path("outter.inner.num").Data().(int))) and it should work.

@x24870
Copy link
Author

x24870 commented Mar 28, 2022

That works, many thanks!

@x24870 x24870 closed this as completed Mar 28, 2022
@x24870 x24870 changed the title gabs.Container.Path() return null, even the value exists gabs.Container.Path() returns null, even the value exists Mar 28, 2022
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

2 participants