I've read this advice couple of times "convert your unit tests to assertions". What does it actually mean? Say in the context of web dev, you add assertions to the code and when they fail you log an exception and move on?
Interesting! I wonder if someone can help me with a problem I'm facing with cgo. I'm trying to include go runtime as apython module (.so) and the code appears to work fine as a standalone program. But when I try to run it from a pre-forked process manager (say Celery for python) the code gets stuck at runtime.futex (from strace). I guess some interplay of python and go runtime w.r.t goroutines. I feel Go is not meant to be embedded in Python runtime.
"I feel Go is not meant to be embedded in Python runtime."
I suspect that it is going to ultimately be your core problem. Even if you make it work with specific versions or specific modules, it'll always be fragile.
Like many modern languages that embed an event loop into themselves one way or another, the Go runtime expects to fully own the target process. It makes it difficult to play well with others, because the "default" C-based runtime provides so few guarantees that it's difficult for two otherwise C-compatible runtimes to "play nice" with each other. It's part of why the JVM and .Net are so interesting for cross-language development; the VM provides a richer, better-specified "base layer" that multiple languages can use, enabling much easier interop.
It's a death-by-a-thousand-cuts sort of thing; hypothetically nothing really prevents this, but in reality you're probably not going to want to take the time to make it work which may very well involve custom modifications of either runtime, when you should probably just go ahead and set up some RPC connections. (JSON's a nice default to prototype quickly, but depending on your needs you may want something like protocol buffers or the half-a-dozen competing libraries.)
Experienced software developer (full stack with backend leanings)
* python (Django/DRF/Flask)
* Javascript (react)
* Go
My expertise is solving hairy/messy problems involving integration with legacy codebase,
though that is not the only thing I am good at.
Some of my last few projects include integration of a django component that I wrote
with a legacy codebase in PHP and a WYSIWYG(almost) editor for PDF generation.
1. Better understanding of goroutines & channels (what patio11 already mentioned).
2. Some more insight into error handling (maybe something on the lines of http://www.golangpatterns.info/error-handling)
I average between 7-8 hours. I drink maybe 2-3 cups of tea in a day. I swim around 3 times a week, squash maybe once or twice a week and kayaking(white water) on some of the weekends.
In time! Lots of social norms we gotta be more understanding of before we expand into South Asia in general.
I have a personal interest in expanding into India and nearby areas, given my family background and a lot of nonprofit work I've done in the past, but we definitely have more operational challenges to sort out before we can focus intently on international expansion with an appropriate amount of tact and attention. In time!
Any links related to it will be helpful.