cybrkyd

Having a go with Go

 Sat, 23 May 2026 08:53 UTC

With my Flask Share app, it was time to consider re-working this into something more production-like. Flask serves the purpose for my needs but Flask is not really a production tool. There is the massive red warning:

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

There are alternative prod-ready web frameworks for Python, but my thinking is that they are all dependencies, in a sense. I’m a huge fan of stdlib and maybe because of this, Python is not really the right tool for the job here.

It is quite possible to re-write the Flask Share app using only stdlib but that will be…wordy. Why do that? When Flask handles all the web stuff so elegantly?

I was reading around on what else I can use in place of Flask and came across a lively discussion somewhere. The OP complained about the loss of cgi in Python 3.13 and how they had to rewrite a chunk of their code when they upgraded. Someone chimed in that perhaps Python was not for them, given the history of the Python core team removing stdlib packages which otherwise still work just fine. Things are removed all the time; maintainers come and go, packages are upgraded and replaced, etc. Perhaps that person should have instead said:

Python is awesome but it is not necessarily the right tool for every job.

Think sledgehammers and walnuts.

As much as I love Python (can you tell?) I think my statement above is correct. It was time to think outside the box.

Trying Go

I have never touched Go. And by that I mean: I have never written a single line of it before this. I have browsed through some code and did sort-of understand the syntax. There are some similarities to Python but my, is it wordy! Sort of like me rewriting the Flask app to use pure stdlib. But…elegant for this use case, I’m forced to admit. It is the right tool.

I knuckled down and learned a bit. The built-in net/http is a God-send, meaning no more external dependencies; Go can do it all.

So that’s what I did. I spent the past couple of weekends translating Python into Go and the results are in. It is bloody fast. Wordy, but fast!

Enough talk, time to show the code.

Here it is, in my repo: https://git.cybrkyd.com/go-share/

»
Tagged in:

Visitors: Loading...