WEEK 6: ENTRY 3
At my internship today, I continued unmarshalling the Json data I got back from Big Query API. Having tried replicating the data on the Go playground and using the Go unmarshall function yesterday, I did develop a better understanding of the json structure. I used Go’s struct to do the unmarshalling. Unlike the json data I got from my query, the documentation’s json data does not have any schema metadata and so I thought the same approach would not work. Little did I know that the schema data can be ignored when unmarshalling json data and that you can only concentrate on the part of the Json you want to unmarshall. When I consulted my buddy, he hopped on a zoom call with me and we did pair programming. I was the driver while he was the navigator, basically explaining what we were doing because he has more knowledge on Go and Json data manipulation.
Working with him gave me more skills and confidence in what I was doing. He helped in not just using the Go struct, but also in trying out the Go interface{} because he realized that the struct I was using was not working. During the debugging process, I learned that just like using Python print statements to debug, Go also works the same way. So too, go use the “ok” and “!ok” keywords to check for errors, which was a new insight for me. In addition, I learned that in Go the order of defining the struct does not matter because Go’s concurrency happens with the execution of the code. I wish I explored other alternatives and just use the struct and log errors when I was developing my logic.
Overall, today was a combination of realizing how important it is to dive deeper on other alternatives and the importance of asking relevant questions when I am stuck. I feel bad when I fail to log the error, so I intend to reduce this type of hindrance because they shouldn’t be recurring. So too, I am more confident to say what I am doing unlike the previous weeks’ sessions. This could be because I am now understanding my project and developing a relentless attitude.
Comments
Post a Comment