How do you know? Either you know enough Go to be able to tell, and thus you'd be able to write this yourself, or you don't and thus you can't really judge.
I mean, it probably is right, but this "I don't know something, but I trust what the chatbot told me" is what worries me about the rise of the LLMs.
On the other hand you can ask gpt to write test and validate at the outside layer that data is transformed the way you need to.
But with ChatGPT you can build it piece by piece.
Not at all. I would even say it is harder because the code being reviewed is priming you.
All code is a leaky abstraction and if you don't know what to look for you just won't see it.
E.g. say you speak python, how would you know how to cleanup memory in C, since you never had to do it? Would you even know that you have to?
It's like with riddles, someone asks you a riddle you think and you think and you draw a blank but if you are given the answer you can instantly validate it even if you didn't know the answer before hand, same with this.
I share the same worry with regards to the way humans will use AI, along with worries about enabling various antisocial behaviours at scale.
So I asked it to write me a struct for a table with the "id, name, longitude, latitude, news" columns. That worked well, I was surprised it automatically inferred the data types for said columns.
Then I asked it to write endpoints for retrieving a record from that table and it did so perfectly which again I was surprised by. Asked it to add endpoints for adding records and retrieving all records. Again, no bugs, perfect code. At the end I asked it to create a python script to test the API and it did so flawlessly.
Next day I created a docker env with postgres and went to test the code but it didn't work, turns out it wrote it with mysql in mind so went back and told it to rewrite the entire code with postgres in mind and again it did so flawlessly so overall writing this small API endpoint took maybe 30-60 min.
Considering I was a total newbie at Go this probably would have taken me several hours to complete successfully and this code is basically just boilerplate. I don't care to learn it by heart so I can be more productive in the future. Now that I have ChatGPT I basically don't have to, I don't have to write python to speed up my dev time, I can just have ChatGPT write the basic stuff in a highly performant language. It removed the only drawback which was more boilerplate.