Member-only story

ChatGPT to process REST Responses in Golang

Sumeet Ninawe
4 min readAug 29, 2023

Working with Golang can be a pain sometimes, especially when you are new and don’t yet appreciate its beauty. A trivial task like processing a JSON response object — which is way easier in JS, to a point where you don’t even have to care about using variables to hold those values — in Golang, becomes too complicated.

But trusting the process and the wise words spoken around, if you be patient and just continue with the tedious process, there will come a point where you would love doing it in Golang. In this post, I help relieve some of that pain.

JSONs are the top-most universal standards defined for communication of text based information across tools, interfaces, and SaaS-based services. It enjoys inherent support in all the major programming languages today — arguably except Golang.

This caused headaches for me for a few weeks, until the requirements forced it down my throat — a hard pill to swallow. Especially, coming from a JS background, I found it absolutely useless to do so much of wiring just to process a simple JSON — forget about the nested ones.

Its a joke — and I say this with a sense of appreciation. It is way too easy to access attributes or loop over a JSON object for processing. Let us consider a simple JSON object that looks like below.

--

--

Sumeet Ninawe
Sumeet Ninawe

Written by Sumeet Ninawe

I write (and sometimes rant) about building a solo business in SaaS. More: https://letsdote.ch

No responses yet