HN user

webtopaz

4 karma
Posts0
Comments4
View on HN
No posts found.

I have worked in outsourced projects for a big company in the past and our team got the work done. I have since then started my own company and have been working for US customers from India. My current customer is a startup from Philly for which I have been working for about 3.5 years. So, No. Indian outsourcing is not doomed. There are thousands of small companies like mine making customers happy at an affordable price.

And what's with the pictures of a snake charmer and a crowded jeep?

Yes. It won't compile.

This check is not really needed as the code would fail when a function which accepts scan.Writer would fail (compilation) if ColumnWriter is sent and if it doesn't satisfy the interface. However, this is easier to debug.

This is how you can make sure that a struct implements an interface. The line 'var _ scan.Writer = (*ColumnWriter)(nil)' assigns a nil pointer of the struct to a scan.Writer interface reference which would fail if ColumnWriter doesn't implement the interface. And the casting always works.

It is a perfectly reasonable way to test for interfaces. A single struct may satisfy a hundred interfaces which it doesn't even know about, this is actually one of the best traits of go.