Hi there 👋

This is Mangat Rai Modi. You will find my notes (mostly rants) on various technology topics. My interests are around Highly scalable architecture, Concurrency and Distributed systems. I am also fond of classical rock music and various forms of fitness training.

Why I stopped writing on Medium

I have been writing on Medium until now, which has been a great experience for me. I really appreciate the simplcity and quality of the platform. Also the posts are SEO optimised. Without me trying to spread my posts I still got some handsome traffic from Google. Infact one of my blog is also a top search result. But I wish things were that simple. I found Medium paywall system highly intrusive....

 · 2 min · Mangat rai Modi

Go:Check Nil Interface the Right Way

I had a simple problem. I have a function which takes a parameter of type interface{}. I need to check it for nil. Any seasoned Go developer will know that a simple i==nil check will not work because interfaces in Go contains both type and value. So you can have cases when — Type is null-able(like map, pointer etc) and value is nil Type itself is nil (of course value will be nil) A nil will only work with option 2 above, as for option 1 a variable still have some type....

 · 3 min · Mangat rai Modi