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
json.unmarshel does not work #848
Comments
this issue was marked as to little info so i made a small example. main.go
models.go
running with go build
running with garble build -seed="random"
|
i also tried reading from a file because maybe this string was being messed up but it was not the case. Still did not work with garble and worked with go build. |
When i move the struct out of my models package and into the main package it works, although this is unoptimal and should be fixed
|
tried "solution" in bigger program and does not work |
because json.unmarshal is not throwing any errors, I think this problem is to do with obfuscating the struct. if you change the names of the fields and your raw json still uses the original field names it wont be able to match the values. |
case in point, I tried to use json.marshal to serialize some directory info and this is the result, its technically working but this is not workable:
as you can see the original field names have been replaced. I think the solution to this is to have an option where you can choose to not obfuscate structs for this reason. |
my temporary solution is to use maps, but i imagine this will be a common issue for a lot of software. |
What version of Garble and Go are you using?
What environment are you running Garble on?
xubuntu
go env
OutputWhat did you do?
json unmarshal does not work, when I unmarshal into a struct and check the struct it is empty even though unmarshel returned no errors. the code works as intended when just using go build.
What did you expect to see?
a struct filled with my info.
What did you see instead?
an empty struct.
The text was updated successfully, but these errors were encountered: