An old binary fooled me for two hours
  • Arxitektura
  • Go
  • i18n
  • Debugging

An old binary fooled me for two hours

29
Today I did two things: I made the data work in three languages, and I burned two hours on a single mistake. About the first one. The interface strings were already translated, but the data itself was not. Project names, descriptions, work history — all of that comes from the database and it also needs three languages. I could have made a separate table per language, but that would have made every query three times more complex. So I picked a simpler pattern: each field gets three variants — the main one, the Russian one and the Uzbek one. One record, three columns. The query does not change, and the site simply picks the language it needs. Now about the second one. I wrote the education section: backend routes, handlers, a data store on the frontend, a trilingual form in the admin panel. Everything ready. I run it — and the old response comes back. I reread the code. Correct. I checked the database. The data was there. I checked the routes. Registered. But the response stayed old. Here was the reason: Go compiles the code, and on the server I was still running the previously compiled file. The new code was sitting on disk, but the thing actually running was the old one. After restarting the service everything worked instantly. I made myself a rule after that: before saying "it does not work", check whether the thing running is actually the new code.