Hacker News new | ask | show | jobs
by Chiron1991 1085 days ago
Not only that, but the Golang example is full of errors. Parameter definitions don't have colons between name and type. The map for seen elements is declared as a, but later referenced to as m. The append instruction references uniques, which is undefined. The return statement also references uniques.
2 comments

ah yes, so a typical example of generative AI output
The Go code shown now is both syntactically valid and semantically correct: https://go.dev/play/p/GDki9v78jMM

I can't check how it looked 15 hours ago.

Makes me wonder if it was manually corrected and is thus a fake example now.