Suraj Deshmukh

Blog

containers, programming, golang, hacks, kubernetes, productivity, books

Suraj Deshmukh

5-Minute Read

Golang and Kubernetes

The client libraries that Kubernetes ships are meant to be imported, and you definitely don’t need this post explaining how to import them in your Golang based project. A simple go get ... should do the trick. But, what about the packages that are not meant to be imported? Or the ones that cannot be imported because of “technical reasons” ? Could you simply add them to your import statements in the .go file, and the go binary will do the right thing when you build the code?…

Cobra and Persistentflags gotchas

How wrong usage of persistent flags can burn you

Suraj Deshmukh

3-Minute Read

If you are using cobra cmd line library for golang applications and it’s PersistentFlags and if you have a use case where you are adding same kind of flag in multiple places. You might burn your fingers in that case, if you keep adding it in multiple sub-commands without giving it a second thought. To understand what is really happening and why it is happening follow along.

Golang struct tags gotchas

Struct tags can give you problems you didn't see coming ;-)

Suraj Deshmukh

1-Minute Read

In golang while using struct tag, the spaces make a lot of difference. For example look at the following code.

Recent Posts

Categories

About

I am a Senior Software Engineer at Microsoft, working on various tooling around container technology like Docker, Kubernetes, etc.